diff options
author | Morten Sørvig <morten.sorvig@qt.io> | 2024-04-15 11:49:51 +0200 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2024-04-22 14:49:02 +0000 |
commit | 8baa2b73a4b11bad3ce4ddf55678a055eb1f9fff (patch) | |
tree | 32484de6a813dc78f3e6529fecdeb001d7e6bbf8 | |
parent | Add license exception (diff) | |
download | qtbase-8baa2b73a4b11bad3ce4ddf55678a055eb1f9fff.tar.xz qtbase-8baa2b73a4b11bad3ce4ddf55678a055eb1f9fff.zip |
Update the cached DPR on QWindow update request
Follow-up from commit 299dfe which added a similar update
for expose events. This fixes missing DPR updates for
exposed windows.
Pick-to: 6.6
Change-Id: Ic1a9a41bd979270b97303abb71f1230bff001d19
Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
(cherry picked from commit 041ca2a3a818955ebcbbc0acd164138ffd561a6c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-rw-r--r-- | src/gui/kernel/qplatformwindow.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/gui/kernel/qplatformwindow.cpp b/src/gui/kernel/qplatformwindow.cpp index 3baa48247b..5c0ae2ee2a 100644 --- a/src/gui/kernel/qplatformwindow.cpp +++ b/src/gui/kernel/qplatformwindow.cpp @@ -778,6 +778,15 @@ void QPlatformWindow::deliverUpdateRequest() QWindow *w = window(); QWindowPrivate *wp = qt_window_private(w); + + // We expect that the platform plugins send DevicePixelRatioChange events. + // As a fail-safe make a final check here to make sure the cached DPR value is + // always up to date before delivering the update request. + if (wp->updateDevicePixelRatio()) { + qWarning() << "The cached device pixel ratio value was stale on window update. " + << "Please file a QTBUG which explains how to reproduce."; + } + wp->updateRequestPending = false; QEvent request(QEvent::UpdateRequest); QCoreApplication::sendEvent(w, &request); |