diff options
author | Morten Sørvig <[email protected]> | 2023-10-10 16:15:40 +0200 |
---|---|---|
committer | Morten Johan Sørvig <[email protected]> | 2024-01-08 21:00:08 +0000 |
commit | 454068232eae457c8f62f94b70e17b0ef8b7a74a (patch) | |
tree | 610e504f440906c439906a42b0ecb461b02d253b /src/gui/kernel/qwindowsysteminterface.cpp | |
parent | 4ae537e67c99160f5dcac99f40d03a7921456556 (diff) |
highdpi: Update high-DPI in QWSI::handleScreenLogicalDotsPerInchChange
Update m_active early during DPI change to make scaling
calls made during the DPI change use the new value.
The existing call to updateHighDpiScaling() in QGuiApplicationPrivate::
processScreenLogicalDotsPerInchChange() is supposed to
take care of this, however that call is made after
the geometry change event is crated (with incorrect
geometry)
Pick-to: 6.7
Change-Id: Ia0f6006c90355ec69ef92b88a020089ab21e072d
Reviewed-by: Tor Arne Vestbø <[email protected]>
Diffstat (limited to 'src/gui/kernel/qwindowsysteminterface.cpp')
-rw-r--r-- | src/gui/kernel/qwindowsysteminterface.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/gui/kernel/qwindowsysteminterface.cpp b/src/gui/kernel/qwindowsysteminterface.cpp index 11af8fcbc36..1875594300c 100644 --- a/src/gui/kernel/qwindowsysteminterface.cpp +++ b/src/gui/kernel/qwindowsysteminterface.cpp @@ -814,6 +814,11 @@ void QWindowSystemInterface::handleScreenGeometryChange(QScreen *screen, const Q void QWindowSystemInterface::handleScreenLogicalDotsPerInchChange(QScreen *screen, qreal dpiX, qreal dpiY) { + // Keep QHighDpiScaling::m_active in sync with platform screen state, in + // order to make scaling calls made during DPI change use the new state. + // FIXME: Remove when QHighDpiScaling::m_active has been removed. + QHighDpiScaling::updateHighDpiScaling(); + const QDpi effectiveDpi = QPlatformScreen::overrideDpi(QDpi{dpiX, dpiY}); handleWindowSystemEvent<QWindowSystemInterfacePrivate::ScreenLogicalDotsPerInchEvent>(screen, effectiveDpi.first, effectiveDpi.second); |