From 9d109333a34e8b362f4f72f82797457ee9119230 Mon Sep 17 00:00:00 2001 From: Jan Grulich Date: Wed, 30 Sep 2020 15:35:27 +0200 Subject: [PATCH] Upstream fix: Emit QScreen::geometryChanged when the logical DPI changes --- qt5-qtbase.spec | 7 ++- ...try-changed-when-logical-dpi-changes.patch | 56 +++++++++++++++++++ 2 files changed, 62 insertions(+), 1 deletion(-) create mode 100644 qtbase-emit-qscreen-geometry-changed-when-logical-dpi-changes.patch diff --git a/qt5-qtbase.spec b/qt5-qtbase.spec index 028a1d6..5bf2c52 100644 --- a/qt5-qtbase.spec +++ b/qt5-qtbase.spec @@ -49,7 +49,7 @@ BuildRequires: pkgconfig(libsystemd) Name: qt5-qtbase Summary: Qt5 - QtBase components Version: 5.15.1 -Release: 4%{?dist} +Release: 5%{?dist} # See LGPL_EXCEPTIONS.txt, for exception details License: LGPLv2 with exceptions or GPLv3 with exceptions @@ -124,6 +124,7 @@ Patch80: qtbase-use-wayland-on-gnome.patch # glibc stat ## upstream patches +Patch100: qtbase-emit-qscreen-geometry-changed-when-logical-dpi-changes.patch # Do not check any files in %%{_qt5_plugindir}/platformthemes/ for requires. # Those themes are there for platform integration. If the required libraries are @@ -382,6 +383,7 @@ Qt5 libraries used for drawing widgets and OpenGL items. %endif ## upstream patches +%patch100 -p1 -b .emit-qscreen-geometry-changed-when-logical-dpi-changes # move some bundled libs to ensure they're not accidentally used pushd src/3rdparty @@ -1039,6 +1041,9 @@ fi %changelog +* Wed Sep 30 2020 Jan Grulich - 5.15.1-5 +- Upstream fix: Emit QScreen::geometryChanged when the logical DPI changes + * Tue Sep 29 2020 Yaroslav Fedevych - 5.15.1-4 - qt5-qtbase-devel requires vulkan headers diff --git a/qtbase-emit-qscreen-geometry-changed-when-logical-dpi-changes.patch b/qtbase-emit-qscreen-geometry-changed-when-logical-dpi-changes.patch new file mode 100644 index 0000000..0b9d6d3 --- /dev/null +++ b/qtbase-emit-qscreen-geometry-changed-when-logical-dpi-changes.patch @@ -0,0 +1,56 @@ +diff --git a/src/gui/kernel/qguiapplication.cpp b/src/gui/kernel/qguiapplication.cpp +index d294cc38..dd31e31c 100644 +--- a/src/gui/kernel/qguiapplication.cpp ++++ b/src/gui/kernel/qguiapplication.cpp +@@ -3155,13 +3155,14 @@ void QGuiApplicationPrivate::processScreenGeometryChange(QWindowSystemInterfaceP + bool availableGeometryChanged = e->availableGeometry != s->d_func()->availableGeometry; + s->d_func()->availableGeometry = e->availableGeometry; + +- if (geometryChanged) { +- Qt::ScreenOrientation primaryOrientation = s->primaryOrientation(); ++ const Qt::ScreenOrientation primaryOrientation = s->primaryOrientation(); ++ if (geometryChanged) + s->d_func()->updatePrimaryOrientation(); + +- emit s->geometryChanged(s->geometry()); ++ s->d_func()->emitGeometryChangeSignals(geometryChanged, availableGeometryChanged); ++ ++ if (geometryChanged) { + emit s->physicalSizeChanged(s->physicalSize()); +- emit s->physicalDotsPerInchChanged(s->physicalDotsPerInch()); + emit s->logicalDotsPerInchChanged(s->logicalDotsPerInch()); + + if (s->primaryOrientation() != primaryOrientation) +@@ -3171,8 +3172,6 @@ void QGuiApplicationPrivate::processScreenGeometryChange(QWindowSystemInterfaceP + updateFilteredScreenOrientation(s); + } + +- s->d_func()->emitGeometryChangeSignals(geometryChanged, availableGeometryChanged); +- + resetCachedDevicePixelRatio(); + } + +diff --git a/src/gui/kernel/qscreen.cpp b/src/gui/kernel/qscreen.cpp +index df628fcc..a1afc1ba 100644 +--- a/src/gui/kernel/qscreen.cpp ++++ b/src/gui/kernel/qscreen.cpp +@@ -88,6 +88,9 @@ void QScreenPrivate::updateGeometriesWithSignals() + void QScreenPrivate::emitGeometryChangeSignals(bool geometryChanged, bool availableGeometryChanged) + { + Q_Q(QScreen); ++ if (geometryChanged) ++ emit q->geometryChanged(geometry); ++ + if (availableGeometryChanged) + emit q->availableGeometryChanged(availableGeometry); + +@@ -96,6 +99,9 @@ void QScreenPrivate::emitGeometryChangeSignals(bool geometryChanged, bool availa + for (QScreen* sibling : siblings) + emit sibling->virtualGeometryChanged(sibling->virtualGeometry()); + } ++ ++ if (geometryChanged) ++ emit q->physicalDotsPerInchChanged(q->physicalDotsPerInch()); + } + + void QScreenPrivate::setPlatformScreen(QPlatformScreen *screen)