Don't update DPR on de-expose events

There is no need to run the catch-all DPR update if
the window is not visible.

Pick-to: 6.6
Fixes: QTBUG-117762
Change-Id: Ib4e235fed4b21e5aa2ecafa960ab0900e2b68295
Reviewed-by: David Edmundson <davidedmundson@kde.org>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
bb10
Morten Sørvig 2023-11-13 13:00:38 +01:00
parent f49d715e93
commit 299dfef52c
1 changed files with 6 additions and 4 deletions

View File

@ -3274,10 +3274,12 @@ void QGuiApplicationPrivate::processExposeEvent(QWindowSystemInterfacePrivate::E
// 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 sending the expose event.
const bool dprWasChanged = QWindowPrivate::get(window)->updateDevicePixelRatio();
if (dprWasChanged)
qWarning() << "The cached device pixel ratio value was stale on window expose. "
<< "Please file a QTBUG which explains how to reproduce.";
if (e->isExposed && !e->region.isEmpty()) {
const bool dprWasChanged = QWindowPrivate::get(window)->updateDevicePixelRatio();
if (dprWasChanged)
qWarning() << "The cached device pixel ratio value was stale on window expose. "
<< "Please file a QTBUG which explains how to reproduce.";
}
// We treat expose events for an already exposed window as paint events
if (wasExposed && p->exposed && shouldSynthesizePaintEvents) {