diff options
author | Laszlo Agocs <laszlo.agocs@qt.io> | 2016-08-09 12:28:30 +0200 |
---|---|---|
committer | Laszlo Agocs <laszlo.agocs@qt.io> | 2016-08-10 09:05:06 +0000 |
commit | 9981f521d96b0369b72ff56bae96175db4148ded (patch) | |
tree | bf69d79dc82a3a177479de0357f17a83198bfffc /src/platformsupport/input | |
parent | e9fe0a15a8ede45020def7059ed4f49a5c20186d (diff) |
libinput: Fix high dpi scaling support
Bring it onto the level of evdevtouch.
Task-number: QTBUG-55182
Change-Id: Iaba58234fa6289870d60f0fcc351d4b97655f3e2
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
Diffstat (limited to 'src/platformsupport/input')
-rw-r--r-- | src/platformsupport/input/libinput/qlibinputtouch.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/platformsupport/input/libinput/qlibinputtouch.cpp b/src/platformsupport/input/libinput/qlibinputtouch.cpp index 0a0e9daccb..1e82ce5c91 100644 --- a/src/platformsupport/input/libinput/qlibinputtouch.cpp +++ b/src/platformsupport/input/libinput/qlibinputtouch.cpp @@ -41,6 +41,7 @@ #include <libinput.h> #include <QtGui/QGuiApplication> #include <QtGui/QScreen> +#include <QtGui/private/qhighdpiscaling_p.h> QT_BEGIN_NAMESPACE @@ -63,7 +64,8 @@ QLibInputTouch::DeviceState *QLibInputTouch::deviceState(libinput_event_touch *e static inline QPointF getPos(libinput_event_touch *e) { - const QSize screenSize = QGuiApplication::primaryScreen()->geometry().size(); + QScreen *screen = QGuiApplication::primaryScreen(); + const QSize screenSize = QHighDpi::toNativePixels(screen->geometry().size(), screen); const double x = libinput_event_touch_get_x_transformed(e, screenSize.width()); const double y = libinput_event_touch_get_y_transformed(e, screenSize.height()); return QPointF(x, y); |