summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorUlrich Ölmann <u.oelmann@pengutronix.de>2019-10-14 12:12:24 +0200
committerUlrich Ölmann <u.oelmann@pengutronix.de>2019-11-06 02:05:54 +0000
commite5078714febaa72bf2f43b3a8ac9caec1c324129 (patch)
tree6553c63eeb416b4b3e3d7eb88e8af44725c37439
parent7f0aaa88ef1db3840bd504d63a38d53032b8f802 (diff)
qlibinputtouch: bugfix: do not skip touch events
Having a platform with Texas Instruments's ADS7846 touch screen controller (NXP i.MX6 DualLite SoC) and a LOGIC Technologies Inc. LTTD800x480 L2RT 7" (800x480 pixels) TFT LCD panel attached to it (resistive touch) using Linux v5.2.17 and libinput-1.12.6 a single one finger touch starts with a LIBINPUT_EVENT_TOUCH_ DOWN directly followed by a LIBINPUT_EVENT_TOUCH_MOTION both having the same touch position. Now Qt's code for touch input processing compressed both into one touch point with state Qt::TouchPointStationary which resulted in QGuiApplicationPrivate:: processTouchEvent() seeing no touch points with state Qt::TouchPointPressed anymore. As a consequence processTouchEvent()'s local container windowsNeeding- Events stayed empty and the whole touch frame was skipped. Fix this by still compressing into one touch point, but keeping its state as Qt::TouchPointPressed. Fixes: QTBUG-79212 Change-Id: Ia571d79ec5c1d6143e923ed69b378503b53e5992 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
-rw-r--r--src/platformsupport/input/libinput/qlibinputtouch.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/platformsupport/input/libinput/qlibinputtouch.cpp b/src/platformsupport/input/libinput/qlibinputtouch.cpp
index a65bc91c39..ad85360b0e 100644
--- a/src/platformsupport/input/libinput/qlibinputtouch.cpp
+++ b/src/platformsupport/input/libinput/qlibinputtouch.cpp
@@ -113,16 +113,16 @@ void QLibInputTouch::processTouchMotion(libinput_event_touch *e)
DeviceState *state = deviceState(e);
QWindowSystemInterface::TouchPoint *tp = state->point(slot);
if (tp) {
+ Qt::TouchPointState tmpState = Qt::TouchPointMoved;
const QPointF p = getPos(e);
- if (tp->area.center() != p) {
+ if (tp->area.center() == p)
+ tmpState = Qt::TouchPointStationary;
+ else
tp->area.moveCenter(p);
- // 'down' may be followed by 'motion' within the same "frame".
- // Handle this by compressing and keeping the Pressed state until the 'frame'.
- if (tp->state != Qt::TouchPointPressed)
- tp->state = Qt::TouchPointMoved;
- } else {
- tp->state = Qt::TouchPointStationary;
- }
+ // 'down' may be followed by 'motion' within the same "frame".
+ // Handle this by compressing and keeping the Pressed state until the 'frame'.
+ if (tp->state != Qt::TouchPointPressed && tp->state != Qt::TouchPointReleased)
+ tp->state = tmpState;
} else {
qWarning("Inconsistent touch state (got 'motion' without 'down')");
}