diff options
author | Morten Johan Sørvig <morten.sorvig@qt.io> | 2020-05-27 10:57:08 +0200 |
---|---|---|
committer | Morten Johan Sørvig <morten.sorvig@qt.io> | 2020-10-20 07:26:24 +0200 |
commit | 95bce5b185ddc736405a952b9132e5c8f51275aa (patch) | |
tree | 0f3c542dade9d5dbfa7aaec86591159d55221c41 /src/platformsupport | |
parent | 73a93981ca6bd641f2c75faf3cdce1fa0711fbb5 (diff) |
QHighDpi: window geometry scaling functions
Add functions which scales window geometry:
framNativeWindowGeometry()
toNativeWindowGeometry()
These correctly handles top-level and child windows,
where top-level window positions scale around the screen
origin while child window positions scale around (0, 0).
Modify call cites to use the new functions. We no longer
need the isTopLevel checks at the call site.
Change-Id: I0158672d46a3f52dfc7d37d021fc5cebd7859200
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Diffstat (limited to 'src/platformsupport')
-rw-r--r-- | src/platformsupport/input/evdevtouch/qevdevtouchhandler.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/platformsupport/input/evdevtouch/qevdevtouchhandler.cpp b/src/platformsupport/input/evdevtouch/qevdevtouchhandler.cpp index 1983a46afb..37b3ec7fec 100644 --- a/src/platformsupport/input/evdevtouch/qevdevtouchhandler.cpp +++ b/src/platformsupport/input/evdevtouch/qevdevtouchhandler.cpp @@ -720,7 +720,7 @@ QRect QEvdevTouchScreenData::screenGeometry() const { if (m_forceToActiveWindow) { QWindow *win = QGuiApplication::focusWindow(); - return win ? QHighDpi::toNativePixels(win->geometry(), win) : QRect(); + return win ? QHighDpi::toNativeWindowGeometry(win->geometry(), win) : QRect(); } // Now it becomes tricky. Traditionally we picked the primaryScreen() |