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.6 6.7 6.8
Fixes: QTBUG-118794
Change-Id: Ia675e84f74dd3c64d6466adc753accbbb650325b
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
This commit is contained in:
Morten Sørvig 2024-06-20 15:44:38 +02:00 committed by Morten Johan Sørvig
parent 780d5a089c
commit 97c12e3f2d

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];
}