Fix evdevtouch coordinates when high DPI scaling is in use

Report coordinates in the native coordinate system.

Change-Id: I1bfc495dd02e9a6033707bccb11066732d6cc0da
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
Reviewed-by: Morten Johan Sørvig <morten.sorvig@theqtcompany.com>
This commit is contained in:
Mitch Curtis 2015-09-21 09:55:37 +02:00 committed by Simon Hausmann
parent 93e64c5489
commit 67d4052be5

View File

@ -38,6 +38,7 @@
#include <QGuiApplication>
#include <QLoggingCategory>
#include <QtCore/private/qcore_unix_p.h>
#include <QtGui/private/qhighdpiscaling_p.h>
#include <QtGui/private/qguiapplication_p.h>
#include <linux/input.h>
@ -604,9 +605,10 @@ void QEvdevTouchScreenData::reportPoints()
QWindow *win = QGuiApplication::focusWindow();
if (!win)
return;
winRect = win->geometry();
winRect = QHighDpi::toNativePixels(win->geometry(), win);
} else {
winRect = QGuiApplication::primaryScreen()->geometry();
QScreen *primary = QGuiApplication::primaryScreen();
winRect = QHighDpi::toNativePixels(primary->geometry(), primary);
}
const int hw_w = hw_range_x_max - hw_range_x_min;