summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2019-09-11 14:42:30 +0200
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2019-09-18 08:29:23 +0200
commita96c4b3aab4592155f7647399f6f2eda98d3908a (patch)
tree540b7a64154e7c430fa80ca61b53a342a2c0b554 /src/gui/kernel
parent90779d96adfa51a3fc00b6c0d93168b4bbfcf983 (diff)
QHighDPI: Fix wrong conversion for native child windows
Do not try to find a screen for native child coordinates. Fixes: QTBUG-78158 Change-Id: I78ba814929f4db3dfd7dd43c09f7c7642222f4fb Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Diffstat (limited to 'src/gui/kernel')
-rw-r--r--src/gui/kernel/qhighdpiscaling.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/gui/kernel/qhighdpiscaling.cpp b/src/gui/kernel/qhighdpiscaling.cpp
index 64f1397771..8189eebedd 100644
--- a/src/gui/kernel/qhighdpiscaling.cpp
+++ b/src/gui/kernel/qhighdpiscaling.cpp
@@ -476,8 +476,10 @@ QHighDpiScaling::ScaleAndOrigin QHighDpiScaling::scaleAndOrigin(const QWindow *w
{
if (!m_active)
return { qreal(1), QPoint() };
+
QScreen *screen = window ? window->screen() : QGuiApplication::primaryScreen();
- return scaleAndOrigin(screen, nativePosition);
+ const bool searchScreen = !window || window->isTopLevel();
+ return scaleAndOrigin(screen, searchScreen ? nativePosition : nullptr);
}
#endif //QT_NO_HIGHDPISCALING