From bf3a67de6c71faee1084ea43ed00a4dfa9d5b8e6 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Fri, 3 Jan 2025 15:15:31 +1000 Subject: [PATCH] gestures: if 3fg drag fingers are in a nice position, start dragging Similar to the condition just north of here, if we have 3 fingers in a roughly linear line and 3fg dragging is enabled, assume we're actually trying to drag. This reduces the minimum movement otherwise required to detect the type of gesture. Part-of: --- src/evdev-mt-touchpad-gestures.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/evdev-mt-touchpad-gestures.c b/src/evdev-mt-touchpad-gestures.c index 6b378205..c429bd2c 100644 --- a/src/evdev-mt-touchpad-gestures.c +++ b/src/evdev-mt-touchpad-gestures.c @@ -1302,6 +1302,14 @@ tp_gesture_detect_motion_gestures(struct tp_dispatch *tp, uint64_t time) return; } + /* If 3fg dragging touches are within a 60x10mm box, start + * dragging immediately */ + if (tp->gesture.finger_count == tp->drag_3fg.nfingers && + distance_mm.x < 60.0 && distance_mm.y < 10.0) { + tp_gesture_handle_event(tp, GESTURE_EVENT_3FG_DRAG_START, time); + return; + } + /* If one touch exceeds the max_move threshold while the other has not * yet passed the min_move threshold, there is either a resting thumb, * or the user is doing "one-finger-scroll," where one touch stays in