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

Do not synthesize window size for MAXIMIZED/FULLSCREEN/TILED states #6182

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

FreeFull
Copy link

It is the responsibility of the Wayland compositor to set the correct size for the window when it is tiled or maximized.
https://wayland.app/protocols/xdg-shell#xdg_toplevel:enum:state also states that in the maximized case, the client needs to obey the geometry provided by the compositor.

Also, in the fullscreen case, with this code in place, Wezterm ends up not taking up the entire screen when there's some kind of bar/panel (easy to reproduce with the default Gnome desktop).

Since the code was added in response to #6108 I have tested this change against Gnome (47.0.1). The other compositors I've tested against are Niri and Sway; With both Niri and Sway, TILED_TOP/BOTTOM/LEFT/RIGHT are set. Sway isn't broken by this code because it doesn't provide suggested_bounds. With Niri, pending_event.configure.replace((w / 2, h)); always runs, and it is completely impossible to resize the window (other than making it fullscreen).

@aliaksandr-trush
Copy link
Contributor

The code change was introduced to fix issues #2375, #4665, #5783, #4667 etc.

Looks like it's requiring some additional investigation since it's braking Niri and does not work perfectly for FULL_SCREEN mode.

@FreeFull
Copy link
Author

The code change was introduced to fix issues #2375, #4665, #5783, #4667 etc.

Looks like it's requiring some additional investigation since it's braking Niri and does not work perfectly for FULL_SCREEN mode.

Could you please test this change, then? I wasn't able to reproduce any weird behaviour with Gnome, myself. Also note that the toggle_fullscreen code that was introduced by the same change is still in place, and it's possible other changes to wezterm (or gnome) since have fixed the other issues too.

@aliaksandr-trush
Copy link
Contributor

Yes, the issue still exists when apply this patch. Initial issue with configuration event. Some logs to explain issue on Gnome:


Run wezterm (new_size contains windowed size by default):
08:56:24.583  INFO   window::os::wayland::window > Configure: WindowConfigure { new_size: (None, None), suggested_bounds: Some((1920, 1048)), decoration_mode: Client, state: WindowState(0x0), capabilities: WindowManagerCapabilities(WINDOW_MENU | MAXIMIZE | FULLSCREEN | MINIMIZE) }
08:56:24.696  INFO   window::os::wayland::window > Configure: WindowConfigure { new_size: (Some(1260), Some(900)), suggested_bounds: Some((1920, 1048)), decoration_mode: Client, state: WindowState(ACTIVATED), capabilities: WindowManagerCapabilities(WINDOW_MENU | MAXIMIZE | FULLSCREEN | MINIMIZE) }

Maximize window (new_size contains full window size):
08:56:25.684  INFO   window::os::wayland::window > Configure: WindowConfigure { new_size: (Some(1920), Some(1048)), suggested_bounds: Some((1920, 1048)), decoration_mode: Client, state: WindowState(MAXIMIZED | ACTIVATED | TILED_LEFT | TILED_RIGHT | TILED_TOP | TILED_BOTTOM), capabilities: WindowManagerCapabilities(WINDOW_MENU | MAXIMIZE | FULLSCREEN | MINIMIZE) }
08:56:25.693  INFO   window::os::wayland::window > Configure: WindowConfigure { new_size: (Some(1920), Some(1048)), suggested_bounds: Some((1920, 1048)), decoration_mode: Client, state: WindowState(MAXIMIZED | ACTIVATED | TILED_LEFT | TILED_RIGHT | TILED_TOP | TILED_BOTTOM), capabilities: WindowManagerCapabilities(WINDOW_MENU | MAXIMIZE | FULLSCREEN | MINIMIZE) }

Alt tab to another window (new_size = windowed size, but should remain as full window size):
08:56:29.947  INFO   window::os::wayland::window > Configure: WindowConfigure { new_size: (Some(1260), Some(900)), suggested_bounds: Some((1920, 1048)), decoration_mode: Client, state: WindowState(MAXIMIZED | TILED_LEFT | TILED_RIGHT | TILED_TOP | TILED_BOTTOM), capabilities: WindowManagerCapabilities(WINDOW_MENU | MAXIMIZE | FULLSCREEN | MINIMIZE) }

Alt tab back to wezterm (new_size still equals to windowed size):
08:56:34.652  INFO   window::os::wayland::window > Configure: WindowConfigure { new_size: (Some(1260), Some(900)), suggested_bounds: Some((1920, 1048)), decoration_mode: Client, state: WindowState(MAXIMIZED | ACTIVATED | TILED_LEFT | TILED_RIGHT | TILED_TOP | TILED_BOTTOM), capabilities: WindowManagerCapabilities(WINDOW_MENU | MAXIMIZE | FULLSCREEN | MINIMIZE) }

Similar behavior for FULL_SCREEN and TILED actions.
I assumed that it could be issues with Smithay/client-toolkit, but examples from the lib works fine for me. So, I will try to continue to investigate why it's behave in such way for wezterm wayland window.

@aliaksandr-trush
Copy link
Contributor

Created issue for tracking: #6262

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.

2 participants