diff options
author | Morten Sørvig <morten.sorvig@qt.io> | 2024-04-15 11:49:51 +0200 |
---|---|---|
committer | Morten Sørvig <morten.sorvig@qt.io> | 2024-04-22 16:48:50 +0200 |
commit | 041ca2a3a818955ebcbbc0acd164138ffd561a6c (patch) | |
tree | c9d79c3438ecd1eb3e0410b7cf4daafbec2eca07 /src/gui | |
parent | 30061e8960eb9d8abb8a98270e3e92beef60d7d3 (diff) |
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 6.7
Change-Id: Ic1a9a41bd979270b97303abb71f1230bff001d19
Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
Diffstat (limited to 'src/gui')
-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); |