Repository navigation
Conversation
KWin marks a window as maximized horizontally when its width fills the screen. Guake called unmaximize() every time it set the window size, so KWin restored the window to its fallback size, 2/3 of the screen width. This happened when leaving fullscreen or when changing the height, and the window stayed narrow. Check is_maximized() first. GTK only reports a window as maximized when it is maximized in both directions, so a window Guake maximized itself (100% width and height) is still unmaximized as before. closes Guake#2117 sem-ver: bugfix
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #2117
Problem
On KDE Plasma, with
window-widthat 100% andwindow-heightbelow 100%, the window sometimes shrinks to 2/3 of the screen width (1280 px on a 1920 px screen). It happens when leaving fullscreen or when the height changes, and the window stays narrow until something resizes it again.Cause
RectCalculator.set_final_window_rect()callswindow.unmaximize()every time it sets the size.resize()is sent at the same time, so the final width depends on which request KWin handles last. That is why it looks random.Fix
Call
unmaximize()only whenwindow.is_maximized()is true. GTK reports a window as maximized only when it is maximized in both directions, so:This is a different change from #2323. That PR changes how the size is applied (
move_resize); this one removes the extra unmaximize. They touch different lines of the same function.How this matches the reports in #2117
maximize()and skips theunmaximize()branch.unmaximize()does nothing andresize()wins.set_final_window_rectcomputing the correct width: Guake asks for the right size, and KWin changes it afterwards.Testing
Environment: KDE Plasma 6 on Wayland, Guake on XWayland (X11 backend), GTK 3.24.52, 1920x1080 screen.
I ran the installed Guake 3.10.1 twice, unmodified and patched, each in its own D-Bus session and config directory, with height 58%, bottom alignment and width 100%. A script showed the window, toggled fullscreen four times over D-Bus, then changed
window-heighttwice. A KWin script logged the window geometry and KWin'smaximizeMode(2 = maximized horizontally).Unmodified, the first time it leaves fullscreen:
Patched: every step stayed 1920 px wide (626 px tall, 615 px at 57%), with
maximizeMode=2the whole time.Checks:
black --check,flake8,pylint(no new messages),reno lintandpytest(30 passed) all pass. I used the versions pinned in the Pipfile, on Python 3.14, the only Python on my machine.