From aa1b1b35acefb55e36a39cf045098405b1238ef2 Mon Sep 17 00:00:00 2001 From: Nate Graham Date: Mon, 8 Feb 2021 11:53:28 -0700 Subject: Fix window positioning regression due to incorrect fallback in fallback We have a fallback string that gets searched for in the KCM, but that fallback itself should not have a fallback, or else we always use that second fallback and the window gets positioned incorrectly the first time it's opened. So let's replace the second fallback with -1. BUG: 432661 FIXED-IN: 5.79 (cherry picked from commit 97accd14d732f3eda1c25bb58290cb9311040798) --- src/gui/kwindowconfig.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/gui/kwindowconfig.cpp b/src/gui/kwindowconfig.cpp index 7a47b17a..4f3ac73a 100644 --- a/src/gui/kwindowconfig.cpp +++ b/src/gui/kwindowconfig.cpp @@ -168,8 +168,8 @@ void KWindowConfig::restoreWindowPosition(QWindow *window, const KConfigGroup &c // per-resolution information is not // TODO: Remove in KF6 or maybe even KF5.85 or something. It really only needs // to be here to transition existing users once they upgrade from 5.78 -> 5.79 - const int fallbackXPosition = config.readEntry(QStringLiteral("%1 XPosition %2").arg(allConnectedScreens()).arg(desk.width()), window->size().width()); - const int fallbackYPosition = config.readEntry(QStringLiteral("%1 YPosition %2").arg(allConnectedScreens()).arg(desk.height()), window->size().height()); + const int fallbackXPosition = config.readEntry(QStringLiteral("%1 XPosition %2").arg(allConnectedScreens()).arg(desk.width()), -1); + const int fallbackYPosition = config.readEntry(QStringLiteral("%1 YPosition %2").arg(allConnectedScreens()).arg(desk.height()), -1); const int xPos = config.readEntry(windowXPositionString(desk), fallbackXPosition); const int yPos = config.readEntry(windowYPositionString(desk), fallbackYPosition); -- cgit v1.2.1