touchpad: only trigger immediate pinch detection for three fingers
authorPeter Hutterer <peter.hutterer@who-t.net>
Wed, 24 Feb 2016 03:46:48 +0000 (13:46 +1000)
committerPeter Hutterer <peter.hutterer@who-t.net>
Sun, 28 Feb 2016 10:35:59 +0000 (20:35 +1000)
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.

https://bugs.freedesktop.org/show_bug.cgi?id=94264

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Tested-by: Jan Alexander Steffens (heftig) <jan.steffens@gmail.com>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
src/evdev-mt-touchpad-gestures.c

index dc8d6060470a42e225d1e6f869dfb3b7f00142f9..3c8f5a7a7d7bef5383829409b64020849234ac0b 100644 (file)
@@ -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) {
                tp_gesture_init_pinch(tp);
                return GESTURE_STATE_PINCH;