From 2d238ae51b8f9e21e6be8266da04781ae1461fcb6c9ad6ecfdfceab2c79e85c9 Mon Sep 17 00:00:00 2001 From: Christophe Giboudeaux Date: Tue, 22 Sep 2020 07:03:57 +0000 Subject: [PATCH] Accepting request 835780 from home:Vogtinator:qtfix - Revert commit to fix screen geometry on startup (boo#1176750, QTBUG-86604): * 0001-Revert-Emit-QScreen-availableG-g-eometryChanged-on-l.patch OBS-URL: https://build.opensuse.org/request/show/835780 OBS-URL: https://build.opensuse.org/package/show/KDE:Qt:5.15/libqt5-qtbase?expand=0&rev=14 --- ...een-availableG-g-eometryChanged-on-l.patch | 98 +++++++++++++++++++ libqt5-qtbase.changes | 6 ++ libqt5-qtbase.spec | 1 + 3 files changed, 105 insertions(+) create mode 100644 0001-Revert-Emit-QScreen-availableG-g-eometryChanged-on-l.patch diff --git a/0001-Revert-Emit-QScreen-availableG-g-eometryChanged-on-l.patch b/0001-Revert-Emit-QScreen-availableG-g-eometryChanged-on-l.patch new file mode 100644 index 0000000..2898de0 --- /dev/null +++ b/0001-Revert-Emit-QScreen-availableG-g-eometryChanged-on-l.patch @@ -0,0 +1,98 @@ +From b885b4a189db2889f3f934a18a9ffc17a9c9077f Mon Sep 17 00:00:00 2001 +From: Fabian Vogt +Date: Sun, 20 Sep 2020 18:19:10 +0200 +Subject: [PATCH] Revert "Emit QScreen::(availableG|g)eometryChanged() on + logical DPI change" + +This reverts commit 370289bef68d8505b66cb27150a3f596e23c5ed3. +--- + src/gui/kernel/qguiapplication.cpp | 10 ++++++++-- + src/gui/kernel/qscreen.cpp | 24 +++--------------------- + src/gui/kernel/qscreen_p.h | 2 -- + 3 files changed, 11 insertions(+), 25 deletions(-) + +diff --git a/src/gui/kernel/qguiapplication.cpp b/src/gui/kernel/qguiapplication.cpp +index 239a78313c..2eee145f27 100644 +--- a/src/gui/kernel/qguiapplication.cpp ++++ b/src/gui/kernel/qguiapplication.cpp +@@ -3178,7 +3178,14 @@ void QGuiApplicationPrivate::processScreenGeometryChange(QWindowSystemInterfaceP + updateFilteredScreenOrientation(s); + } + +- s->d_func()->emitGeometryChangeSignals(geometryChanged, availableGeometryChanged); ++ if (availableGeometryChanged) ++ emit s->availableGeometryChanged(s->availableGeometry()); ++ ++ if (geometryChanged || availableGeometryChanged) { ++ const auto siblings = s->virtualSiblings(); ++ for (QScreen* sibling : siblings) ++ emit sibling->virtualGeometryChanged(sibling->virtualGeometry()); ++ } + + resetCachedDevicePixelRatio(); + } +@@ -3198,7 +3205,6 @@ void QGuiApplicationPrivate::processScreenLogicalDotsPerInchChange(QWindowSystem + s->d_func()->logicalDpi = QDpi(e->dpiX, e->dpiY); + + emit s->logicalDotsPerInchChanged(s->logicalDotsPerInch()); +- s->d_func()->updateGeometriesWithSignals(); + + resetCachedDevicePixelRatio(); + } +diff --git a/src/gui/kernel/qscreen.cpp b/src/gui/kernel/qscreen.cpp +index df628fcc73..d5a4b7c027 100644 +--- a/src/gui/kernel/qscreen.cpp ++++ b/src/gui/kernel/qscreen.cpp +@@ -77,33 +77,15 @@ QScreen::QScreen(QPlatformScreen *screen) + d->setPlatformScreen(screen); + } + +-void QScreenPrivate::updateGeometriesWithSignals() +-{ +- const QRect oldGeometry = geometry; +- const QRect oldAvailableGeometry = availableGeometry; +- updateHighDpi(); +- emitGeometryChangeSignals(oldGeometry != geometry, oldAvailableGeometry != availableGeometry); +-} +- +-void QScreenPrivate::emitGeometryChangeSignals(bool geometryChanged, bool availableGeometryChanged) +-{ +- Q_Q(QScreen); +- if (availableGeometryChanged) +- emit q->availableGeometryChanged(availableGeometry); +- +- if (geometryChanged || availableGeometryChanged) { +- const auto siblings = q->virtualSiblings(); +- for (QScreen* sibling : siblings) +- emit sibling->virtualGeometryChanged(sibling->virtualGeometry()); +- } +-} +- + void QScreenPrivate::setPlatformScreen(QPlatformScreen *screen) + { + Q_Q(QScreen); + platformScreen = screen; + platformScreen->d_func()->screen = q; + orientation = platformScreen->orientation(); ++ geometry = platformScreen->deviceIndependentGeometry(); ++ availableGeometry = QHighDpi::fromNative(platformScreen->availableGeometry(), ++ QHighDpiScaling::factor(platformScreen), geometry.topLeft()); + + logicalDpi = QPlatformScreen::overrideDpi(platformScreen->logicalDpi()); + +diff --git a/src/gui/kernel/qscreen_p.h b/src/gui/kernel/qscreen_p.h +index 7da542c25e..e5988ff829 100644 +--- a/src/gui/kernel/qscreen_p.h ++++ b/src/gui/kernel/qscreen_p.h +@@ -72,8 +72,6 @@ public: + } + + void updatePrimaryOrientation(); +- void updateGeometriesWithSignals(); +- void emitGeometryChangeSignals(bool geometryChanged, bool availableGeometryChanged); + + QPlatformScreen *platformScreen = nullptr; + +-- +2.25.1 + diff --git a/libqt5-qtbase.changes b/libqt5-qtbase.changes index f3865fd..5ed341a 100644 --- a/libqt5-qtbase.changes +++ b/libqt5-qtbase.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Mon Sep 21 09:55:25 UTC 2020 - Fabian Vogt + +- Revert commit to fix screen geometry on startup (boo#1176750, QTBUG-86604): + * 0001-Revert-Emit-QScreen-availableG-g-eometryChanged-on-l.patch + ------------------------------------------------------------------- Thu Sep 10 07:57:00 UTC 2020 - Fabian Vogt diff --git a/libqt5-qtbase.spec b/libqt5-qtbase.spec index d98b69a..5ef26a4 100644 --- a/libqt5-qtbase.spec +++ b/libqt5-qtbase.spec @@ -66,6 +66,7 @@ Patch12: 0001-Add-remote-print-queue-support.patch # PATCH-FIX-OPENSUSE Patch21: 0001-Don-t-white-list-recent-Mesa-versions-for-multithrea.patch Patch24: fix-fixqt4headers.patch +Patch25: 0001-Revert-Emit-QScreen-availableG-g-eometryChanged-on-l.patch # patches 1000-2000 and above from upstream 5.15 branch # # patches 2000-3000 and above from upstream qt6/dev branch # # Not accepted yet, https://codereview.qt-project.org/c/qt/qtbase/+/255384