[PATCH libinput] touchpad: only trigger immediate pinch detection for three fingers

Peter Hutterer peter.hutterer at who-t.net
Fri Feb 26 00:49:36 UTC 2016

If the fingers are vertically apart by more than 20mm we used to assume a
pinch gesture immediately. This is too close together for some users during
two-finger scrolling. Since we should always bias towards scrolling, only
trigger this detection for three fingers, the rest has to go through the
movement detection.

The reason for the pinch detection here was to differentiate from 3fg swipe
gestures (83f3dbd1), hence we're still in spirit of that patch.


Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
 src/evdev-mt-touchpad-gestures.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/evdev-mt-touchpad-gestures.c b/src/evdev-mt-touchpad-gestures.c
index dc8d606..3c8f5a7 100644
--- a/src/evdev-mt-touchpad-gestures.c
+++ b/src/evdev-mt-touchpad-gestures.c
@@ -339,6 +339,7 @@ tp_gesture_handle_state_unknown(struct tp_dispatch *tp, uint64_t time)
 	/* Else check if one finger is > 20mm below the others */
 	vert_distance = abs(first->point.y - second->point.y);
 	if (vert_distance > 20 * yres &&
+	    tp->gesture.finger_count > 2 &&
 	    tp->gesture.enabled) {

More information about the wayland-devel mailing list