From b57c7ad9acf45928a6debefcd432cc50432fefdb Mon Sep 17 00:00:00 2001 From: Nate Graham Date: Mon, 1 Feb 2021 13:24:03 -0700 Subject: 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 --- src/gui/kwindowconfig.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/gui/kwindowconfig.cpp') 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); -- cgit v1.2.1