gestures: do not use thumb for pinch when is used to press the clickpad

The changes made in ca3df8a076 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>
This commit is contained in:
José Expósito 2021-12-08 17:32:03 +01:00 committed by Peter Hutterer
parent 00e0c17688
commit 1262c81d9b

View file

@ -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;