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: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1042>
This commit is contained in:
Peter Hutterer 2025-01-03 15:15:31 +10:00 committed by Marge Bot
parent 1d9e307e2b
commit bf3a67de6c

View file

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