summaryrefslogtreecommitdiffstats
path: root/src/platformsupport/input/evdevmouse/qevdevmousemanager.cpp
diff options
context:
space:
mode:
authorMorten Johan Sørvig <morten.sorvig@theqtcompany.com>2015-11-05 13:34:36 +0100
committerMorten Johan Sørvig <morten.sorvig@theqtcompany.com>2015-11-18 14:11:41 +0000
commit6f8a19846ba51966f524a7b9eb2c4a2b118f4b47 (patch)
treedbf87bc7e3528f7afbf953dac2052c39dcc37a63 /src/platformsupport/input/evdevmouse/qevdevmousemanager.cpp
parent3510c7324d34eb4c67fa6c8fdf0507e87eb1d25e (diff)
Input: Convert QScreen geometry to native pixels
Low-level input handling uses the native coordinate system and the (device independent) coordinates from QScreen needs to be converted. Change-Id: I501dc77f5e51be01a42e533cd0609e069b8d228b Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com> Reviewed-by: Morten Johan Sørvig <morten.sorvig@theqtcompany.com>
Diffstat (limited to 'src/platformsupport/input/evdevmouse/qevdevmousemanager.cpp')
-rw-r--r--src/platformsupport/input/evdevmouse/qevdevmousemanager.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/platformsupport/input/evdevmouse/qevdevmousemanager.cpp b/src/platformsupport/input/evdevmouse/qevdevmousemanager.cpp
index 805397f021..68db0b26ba 100644
--- a/src/platformsupport/input/evdevmouse/qevdevmousemanager.cpp
+++ b/src/platformsupport/input/evdevmouse/qevdevmousemanager.cpp
@@ -41,6 +41,7 @@
#include <QtPlatformSupport/private/qdevicediscovery_p.h>
#include <private/qguiapplication_p.h>
#include <private/qinputdevicemanager_p_p.h>
+#include <private/qhighdpiscaling_p.h>
QT_BEGIN_NAMESPACE
@@ -106,7 +107,8 @@ QEvdevMouseManager::~QEvdevMouseManager()
void QEvdevMouseManager::clampPosition()
{
// clamp to screen geometry
- QRect g = QGuiApplication::primaryScreen()->virtualGeometry();
+ QScreen *primaryScreen = QGuiApplication::primaryScreen();
+ QRect g = QHighDpi::toNativePixels(primaryScreen->virtualGeometry(), primaryScreen);
if (m_x + m_xoffset < g.left())
m_x = g.left() - m_xoffset;
else if (m_x + m_xoffset > g.right())