aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorNate Graham <nate@kde.org>2020-12-07 12:26:11 -0700
committerNate Graham <nate@kde.org>2020-12-07 15:15:28 -0700
commite5fb03b6e915b176ae8804ae7317ff1977848487 (patch)
tree6211d2e57d202ee180ac382cb48e8c8d63f8e632 /src
parentd894326ecce3ec63d8a909099263eaf1a2a0427a (diff)
downloadkconfig-e5fb03b6e915b176ae8804ae7317ff1977848487.tar.gz
kconfig-e5fb03b6e915b176ae8804ae7317ff1977848487.tar.bz2
Fix window sizing and positioning on Windows
The feature to make windows remember their sizes and positions across screen layouts relied on calling QScreen::name() to identify screens. Unfortunately this function returns garbage on Windows; see https://bugreports.qt.io/browse/QTBUG-74317 So on Windows, let's identify displays by serial number as a workaround. BUG: 429943 FIXED-IN: 5.78
Diffstat (limited to 'src')
-rw-r--r--src/gui/kwindowconfig.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/gui/kwindowconfig.cpp b/src/gui/kwindowconfig.cpp
index bb541b8e..4181651f 100644
--- a/src/gui/kwindowconfig.cpp
+++ b/src/gui/kwindowconfig.cpp
@@ -21,7 +21,13 @@ static QString allConnectedScreens()
const auto screens = QGuiApplication::screens();
names.reserve(screens.length());
for (auto screen : screens) {
+#ifdef Q_OS_WIN
+ // QScreen::name() returns garbage on Windows; see https://bugreports.qt.io/browse/QTBUG-74317
+ // So we use the screens' serial numbers to identify them instead
+ names << screen->serialNumber();
+#else
names << screen->name();
+#endif
}
return names.join(QLatin1Char(' '));
}