gestures: always save touch information

When a single touch is used to hold or to move the pointer, save
information about the touch.

Signed-off-by: José Expósito <jose.exposito89@gmail.com>
This commit is contained in:
José Expósito 2021-05-31 17:57:44 +02:00 committed by Peter Hutterer
parent 5603ed867d
commit 13c47598bc

View file

@ -979,10 +979,16 @@ tp_gesture_handle_state_none(struct tp_dispatch *tp, uint64_t time)
ntouches = tp_gesture_get_active_touches(tp, touches, 4);
first = touches[0];
second = touches[1];
if (ntouches == 0)
return;
if (ntouches == 1) {
first->gesture.initial = first->point;
tp->gesture.touches[0] = first;
tp_gesture_handle_event(tp,
GESTURE_EVENT_FINGER_DETECTED,
time);
@ -996,9 +1002,6 @@ tp_gesture_handle_state_none(struct tp_dispatch *tp, uint64_t time)
return;
}
first = touches[0];
second = touches[1];
/* For 3+ finger gestures, we only really need to track two touches.
* The human hand's finger arrangement means that for a pinch, the
* bottom-most touch will always be the thumb, and the top-most touch