diff options
author | José Expósito <jose.exposito89@gmail.com> | 2021-12-08 17:32:03 +0100 |
---|---|---|
committer | Peter Hutterer <peter.hutterer@who-t.net> | 2021-12-14 05:42:35 +0000 |
commit | 1262c81d9b0d560e7b8cbbecdf05b081d7d94f9b (patch) | |
tree | 12f76cce46390c7ab0d504b9bb17111eb1ae756b | |
parent | 00e0c176889d1878aa077b9869f3ea02ca0cf968 (diff) | |
download | libinput-1262c81d9b0d560e7b8cbbecdf05b081d7d94f9b.tar.gz |
gestures: do not use thumb for pinch when is used to press the clickpad
The changes made in ca3df8a076d54a93b3c2fb8a5eea4326d487050c to improve
pinch detection introduced a regression:
When the thumb is used to press the clickpad it is automatically tagged
as thumb and the gesture state machine does not initialize it, leaving
its initial X and Y position set to 0.
When another finger is put on the clickpad, the distance moved by the
thumb is checked and because its initial position is 0 movement is
detected.
Add an additional check to take into account only thumbs that are used
in the gesture.
Fix #708
Signed-off-by: José Expósito <jose.exposito89@gmail.com>
-rw-r--r-- | src/evdev-mt-touchpad-gestures.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/evdev-mt-touchpad-gestures.c b/src/evdev-mt-touchpad-gestures.c index dc2b6536..bf259423 100644 --- a/src/evdev-mt-touchpad-gestures.c +++ b/src/evdev-mt-touchpad-gestures.c @@ -1283,6 +1283,9 @@ tp_gesture_thumb_moved(struct tp_dispatch *tp) if (!thumb) return false; + if (!tp_touch_active_for_gesture(tp, thumb)) + return false; + thumb_moved = tp_gesture_mm_moved(tp, thumb); thumb_mm = hypot(thumb_moved.x, thumb_moved.y); return thumb_mm >= PINCH_DISAMBIGUATION_MOVE_THRESHOLD; |