On Wayland, unmaximizing a non-maximized window and immediately setting its size fails
Tiny bug noticed first in virt-manager, affects just the Wayland session (at least on KDE, did not test elsewhere).
If you call window.unmaximize()
, then window.resize(...)
or .set_default_size(...)
immediately afterwards, the behavior is erratic.
On Gtk3 (3.24.37):
-
❌ If the window is not maximized, nothing happens. -
✅ If the window is maximized, the window unmaximizes and gets its size set correctly. -
✅ If you checkif window.is_maximized(): window.unmaximize()
first, the behavior is always correct. - Repro: test-gtk3.py
On Gtk4 (4.10.1):
-
❌ If the window is not maximized, the new size gets set for a single frame, then returns back to the original size. -
❌ If the window is maximized, the window unmaximizes, but the size does not change. -
❌ If you checkif window.is_maximized(): window.unmaximize()
first, the first scenario behaves as expected, the second one still does not change the window size. - Repro: test-gtk4.py
The expected behavior is that the window successfully unmaximizes and sets its size correctly, regardless of the initial state.
In both cases, the behavior was noticed on:
- Arch Linux (up-to-date as of 2023-04-18)
- KDE Plasma 5.27.4 + Frameworks 5.105.0 + Qt 5.15.9
- Wayland session
- AMD Radeon 6800 on Mesa 23.0.2
Edited by Dragoon Aethis