Update QWindow DPR on screen DPI change

The window device pixel ratio may change when the DPI
changes. Call the DPR update function, which will poll
for the current value and update the cached value and
send DevicePixelRatioChanged events if needed.

Change-Id: I5d5ac5d24a693d06eb9b1f005a91677e703f8a58
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
This commit is contained in:
Morten Sørvig 2023-03-03 16:24:09 +01:00
parent 3965d808c0
commit 01cdda3502

View File

@ -3176,6 +3176,10 @@ void QGuiApplicationPrivate::processScreenLogicalDotsPerInchChange(QWindowSystem
s->d_func()->updateGeometry();
}
for (QWindow *window : QGuiApplication::allWindows())
if (window->screen() == e->screen)
QWindowPrivate::get(window)->updateDevicePixelRatio();
resetCachedDevicePixelRatio();
}