From 7095aa70d2cf2e731bf014148f87961ecf6cd6f5 Mon Sep 17 00:00:00 2001 From: diogopinto <53532032+Di0go@users.noreply.github.com> Date: Thu, 8 Oct 2026 23:18:27 +0100 Subject: [PATCH] Only unmaximize the window when it is maximized 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 #2117 sem-ver: bugfix --- guake/utils.py | 5 ++++- releasenotes/notes/bugfix-3b43f5126a83b026.yaml | 5 +++++ 2 files changed, 9 insertions(+), 1 deletion(-) create mode 100644 releasenotes/notes/bugfix-3b43f5126a83b026.yaml diff --git a/guake/utils.py b/guake/utils.py index dc07c80e6..77991c5fd 100644 --- a/guake/utils.py +++ b/guake/utils.py @@ -311,7 +311,10 @@ def set_final_window_rect(cls, settings, window): window.maximize() elif not FullscreenManager(settings, window).is_fullscreen(): log.debug("RESIZING MAIN WINDOW TO THE FOLLOWING VALUES:") - window.unmaximize() + # KWin marks a full-width window as maximized horizontally. Calling + # unmaximize() on it makes KWin shrink it to 2/3 of the screen width (#2117). + if window.is_maximized(): + window.unmaximize() log.debug(" window_rect.x: %s", window_rect.x) log.debug(" window_rect.y: %s", window_rect.y) log.debug(" window_rect.height: %s", window_rect.height) diff --git a/releasenotes/notes/bugfix-3b43f5126a83b026.yaml b/releasenotes/notes/bugfix-3b43f5126a83b026.yaml new file mode 100644 index 000000000..00ac03fe0 --- /dev/null +++ b/releasenotes/notes/bugfix-3b43f5126a83b026.yaml @@ -0,0 +1,5 @@ +fixes: + - | + On KDE Plasma, a window with 100% width no longer shrinks to 2/3 of the screen width + when it is shown or leaves fullscreen. Guake now only unmaximizes the window when it + is maximized. #2117