aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNate Graham <nate@kde.org>2021-02-01 13:24:03 -0700
committerNate Graham <nate@kde.org>2021-02-02 07:40:49 -0700
commitb57c7ad9acf45928a6debefcd432cc50432fefdb (patch)
tree5c6a28f33707bae95b7e8d3ff83b51eb56b6a7ee
parent828ba0e02269a072a95729f415cef07b77e897a5 (diff)
downloadkconfig-b57c7ad9acf45928a6debefcd432cc50432fefdb.tar.gz
kconfig-b57c7ad9acf45928a6debefcd432cc50432fefdb.tar.bz2
Fix restoring window size when closed while maximized
The maximization string was being saved to the config file including the connected screens, but the code to read it was not, and was also looking for the old incorrect format. This could have resulted in old config values being used forever, and the window always being opened in a maximized state. BUG: 430521 FIXED-IN: 5.79
-rw-r--r--src/gui/kwindowconfig.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/gui/kwindowconfig.cpp b/src/gui/kwindowconfig.cpp
index c28ed0ff..98fb5165 100644
--- a/src/gui/kwindowconfig.cpp
+++ b/src/gui/kwindowconfig.cpp
@@ -129,7 +129,8 @@ void KWindowConfig::restoreWindowPosition(QWindow *window, const KConfigGroup &c
}
const QRect desk = window->screen()->geometry();
- const bool isMaximized = config.readEntry(QStringLiteral("Window-Maximized %1x%2").arg(desk.height()).arg(desk.width()), false);
+ const QString allScreens = allConnectedScreens();
+ const bool isMaximized = config.readEntry(allScreens + QStringLiteral(" Window-Maximized %1x%2").arg(desk.width()).arg(desk.height()), false);
// Don't need to restore position if the window was maximized
if (isMaximized) {
@@ -137,7 +138,6 @@ void KWindowConfig::restoreWindowPosition(QWindow *window, const KConfigGroup &c
return;
}
- const QString allScreens = allConnectedScreens();
const int xPos = config.readEntry(allScreens + QStringLiteral(" XPosition"), -1);
const int yPos = config.readEntry(allScreens + QStringLiteral(" YPosition"), -1);