From 13c47598bc98bc671819120429e4afbcd38a4e4d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Exp=C3=B3sito?= Date: Mon, 31 May 2021 17:57:44 +0200 Subject: [PATCH] gestures: always save touch information MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When a single touch is used to hold or to move the pointer, save information about the touch. Signed-off-by: José Expósito --- src/evdev-mt-touchpad-gestures.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/evdev-mt-touchpad-gestures.c b/src/evdev-mt-touchpad-gestures.c index 44a9261b..01bd53da 100644 --- a/src/evdev-mt-touchpad-gestures.c +++ b/src/evdev-mt-touchpad-gestures.c @@ -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