summaryrefslogtreecommitdiffstats
path: root/src/platformsupport/input/libinput/qlibinputtouch.cpp
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@qt.io>2019-11-13 07:20:23 +0100
committerLiang Qi <liang.qi@qt.io>2019-11-13 07:21:33 +0100
commitd140f2f61499f424983582770af8c28399a373c1 (patch)
treeb05dc03863502293083ded9d61fc344ab5a9da7b /src/platformsupport/input/libinput/qlibinputtouch.cpp
parentbf131e8d2181b3404f5293546ed390999f760404 (diff)
parent8ffb200153d1b1a8402c875c4961160efb149201 (diff)
Merge remote-tracking branch 'origin/5.13' into 5.14
Conflicts: examples/widgets/widgets/scribble/mainwindow.cpp This amends cb54c16584cf3be746a1a536c1e37cb3022a2f1b. Change-Id: Iaae60a893330524b2973917e23b31f9d51f8bd38
Diffstat (limited to 'src/platformsupport/input/libinput/qlibinputtouch.cpp')
-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')");
}