Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

view: unconditionally center views in output layout #278

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

joggee-fr
Copy link
Collaborator

Some applications e.g. weston-flower does not really accept to be maximized and kept its surface to a fixed size. In such a case, force the surface to be recentered for a nicer display.


This patch is again inspired by what is already done in Sway. However there is a small drawback, the window move can be observed briefly.

@joggee-fr
Copy link
Collaborator Author

I have just read this quote from the project page:

[...] a kiosk compositor displays a single maximized application at a time and prevents the user from interacting with anything but this application.

However with or without the proposed patch, we are able to interact with a background application when also starting a non-maximizable application such as weston-flower in the foreground.

@joggee-fr
Copy link
Collaborator Author

Looking for opinions. Should we be able to interact with an application in background if it is behind a non-maximizable one?

xdg_shell.c Outdated Show resolved Hide resolved
@emersion
Copy link
Contributor

emersion commented Jan 3, 2024

Looking for opinions. Should we be able to interact with an application in background if it is behind a non-maximizable one?

I'd say yes, because (1) multiple windows on top of each other is somewhat important to support for dialogs (e.g. open/save window in text editors) and (2) without any kind of visual feedback (like GNOME's dimmed main window when a dialog window is opened) it's hard for the user to understand why input events aren't going through to the window behind.

(Alternatively we could dim the window underneath, but this would be a larger change and a bit opinionated.)

@joggee-fr joggee-fr marked this pull request as draft January 4, 2024 09:02
@joggee-fr joggee-fr changed the title xdg_shell: force surface to be recentered when it can't be maximized view: unconditionally center views in output layout Feb 8, 2024
@joggee-fr joggee-fr marked this pull request as ready for review February 8, 2024 16:34
@joggee-fr
Copy link
Collaborator Author

New version now always position all view in the center of the output layout then try to maximize just like before.
XDG shell commit handler is added to check dimension change and re-position the view in such a case.

@joggee-fr
Copy link
Collaborator Author

Rebased and added a commit to fix issue #254 considering top left corner declared in window geometry.

Whatever type or dimensions of a view, position it at center of the
output layout. Then, if it is a primary view or if it extends the output
layout, send request to maximize it.
The client may or may not change the view dimensions after that.
If not, e.g. weston-flower, the view will be kept displayed at center
instead of to left.
If so, the view will expand from center to fill the whole output layout.

In order to update the view position, XDG shell surface commit is now
handled to check for dimension change.
@joggee-fr
Copy link
Collaborator Author

Rebased to current master HEAD.

@joggee-fr joggee-fr requested a review from emersion March 13, 2024 10:44
@joggee-fr
Copy link
Collaborator Author

@emersion, if you have time to review theses changes as they should also fix issue #254.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants