macOS: send DPR change on BackingPropertiesChange

AppKit sends the viewDidChangeBackingProperties message
to the view when the backing store scale changes.
Propagate to QtGui via handleWindowDevicePixelRatioChanged.

Pick-to: 6.7 6.6
Fixes: QTBUG-118794
Change-Id: Ia675e84f74dd3c64d6466adc753accbbb650325b
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 97c12e3f2dc1e2114aeb8abaff4d551b112887ef)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
Morten Sørvig 2024-06-20 15:44:38 +02:00 committed by Qt Cherry-pick Bot
parent 5fa620173e
commit 10397e5351

View File

@ -147,7 +147,15 @@
// Ideally we would plumb this situation through QPA in a way that lets
// clients invalidate their own caches, recreate QBackingStore, etc.
// For now we trigger an expose, and let QCocoaBackingStore deal with
// QPA supports DPR (scale) change notifications. We are not sure
// based on this event that it is the scale that has changed (it
// could be the color space), however QPA will determine if it has
// actually changed.
QWindowSystemInterface::handleWindowDevicePixelRatioChanged
<QWindowSystemInterface::SynchronousDelivery>(m_platformWindow->window());
// Trigger an expose, and let QCocoaBackingStore deal with
// buffer invalidation internally.
[self setNeedsDisplay:YES];
}