macOS: Query platform window for size when flushing child windows

Otherwise we will not pick up the effects of the QHighDpiScaling layer
to the QWindow size, such as when setting QT_SCALE_FACTOR explicitly.

Fixes: QTBUG-122967
Pick-to: 6.7 6.5 6.2
Change-Id: I9dc914728c5aff28ef52ea3a502c94bcc91738bd
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 270866923cce6184cd368fc5466e79bf5f845549)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
Tor Arne Vestbø 2024-08-21 13:56:03 +02:00 committed by Qt Cherry-pick Bot
parent 589661c0d5
commit 7229cc75a4

View File

@ -399,7 +399,9 @@ void QCALayerBackingStore::flushSubWindow(QWindow *subWindow)
subWindowBackingStore->m_clearSurfaceOnPaint = false; subWindowBackingStore->m_clearSurfaceOnPaint = false;
} }
auto subWindowSize = subWindow->size(); // Query platform window for subwindow size, so that we
// incorporate any effects of the QHighDpiScaling layer.
auto subWindowSize = subWindow->handle()->geometry().size();
static const auto kNoStaticContents = QRegion(); static const auto kNoStaticContents = QRegion();
subWindowBackingStore->resize(subWindowSize, kNoStaticContents); subWindowBackingStore->resize(subWindowSize, kNoStaticContents);