summaryrefslogtreecommitdiffstats
path: root/src/plugins
diff options
context:
space:
mode:
authorTor Arne Vestbø <tor.arne.vestbo@qt.io>2022-09-07 15:17:32 +0200
committerTor Arne Vestbø <tor.arne.vestbo@qt.io>2022-09-08 12:49:30 +0200
commita0b34a86b684d36fed5d11ce063b2629fd4e4598 (patch)
tree68e75b16ba0ca9c7c334638d22532867a9990fdc /src/plugins
parent936d33849c31c020edfa9fdf04aec29d14cb133f (diff)
Move QPlatformScreen::deviceIndependentGeometry() logic to QScreen
Having the logic in QPlatformScreen was inconsistent with how the high-DPI scaling logic sits on top of the platform layer, and also made the implementation of QScreenPrivate::updateHighDpi() a bit inconsistent in how the geometry vs available geometry was resolved. Change-Id: I683ab34dfc8579e2c887cb8fe3059c9c9fdb71a7 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/platforms/xcb/qxcbwindow.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/plugins/platforms/xcb/qxcbwindow.cpp b/src/plugins/platforms/xcb/qxcbwindow.cpp
index a37c03cc60..7ea0b3a29b 100644
--- a/src/plugins/platforms/xcb/qxcbwindow.cpp
+++ b/src/plugins/platforms/xcb/qxcbwindow.cpp
@@ -97,9 +97,11 @@ QXcbScreen *QXcbWindow::parentScreen()
return parent() ? static_cast<QXcbWindow*>(parent())->parentScreen() : xcbScreen();
}
-//QPlatformWindow::screenForGeometry version that uses deviceIndependentGeometry
QXcbScreen *QXcbWindow::initialScreen() const
{
+ // Resolve initial screen via QWindowPrivate::screenForGeometry(),
+ // which works in platform independent coordinates, as opposed to
+ // QPlatformWindow::screenForGeometry() that uses native coordinates.
QWindowPrivate *windowPrivate = qt_window_private(window());
QScreen *screen = windowPrivate->screenForGeometry(window()->geometry());
return static_cast<QXcbScreen*>(screen->handle());