From f5f12926b1ead2f36b2f7e8fc34ff864b5b6d60e Mon Sep 17 00:00:00 2001 From: Nate Graham Date: Tue, 4 May 2021 21:59:43 -0600 Subject: Don't write position data for maximized windows A window that is maximized does not really have a position on screen other then the fact that it's maximized, and writing out position data in this case anyway will only serve to mis-position the window once da-maximized, should KWin ever stop remembering de-maximized window positions internally. CCBUG: 434116 --- src/gui/kwindowconfig.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src') diff --git a/src/gui/kwindowconfig.cpp b/src/gui/kwindowconfig.cpp index 019e1aa2..38b4b929 100644 --- a/src/gui/kwindowconfig.cpp +++ b/src/gui/kwindowconfig.cpp @@ -140,6 +140,12 @@ void KWindowConfig::saveWindowPosition(const QWindow *window, KConfigGroup &conf return; } + // If the window is maximized, saving the position will only serve to mis-position + // it once de-maximized, so let's not do that + if (window->windowState() & Qt::WindowMaximized) { + return; + } + const QRect desk = window->screen()->geometry(); config.writeEntry(windowXPositionString(desk), window->x(), options); config.writeEntry(windowYPositionString(desk), window->y(), options); -- cgit v1.2.1