gestures: check ntouches, not just num_slots for the number of fingers
authorPeter Hutterer <peter.hutterer@who-t.net>
Wed, 29 Jul 2015 07:12:53 +0000 (17:12 +1000)
committerPeter Hutterer <peter.hutterer@who-t.net>
Thu, 30 Jul 2015 00:35:55 +0000 (10:35 +1000)
We need to check fake fingers as well as real fingers, especially for
two-finger scrolling on single-touch touchpads with BTN_TOOL_DOUBLETAP.

https://bugzilla.redhat.com/show_bug.cgi?id=1246651

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
src/evdev-mt-touchpad-gestures.c

index 8bcdeb40377669d361aec094dc083426702a82fc..6b1a273c26997c3bfee49b6af34f5ce1a71e4b0c 100644 (file)
@@ -157,7 +157,7 @@ tp_gesture_get_active_touches(struct tp_dispatch *tp,
 
        memset(touches, 0, count * sizeof(struct tp_touch *));
 
-       for (i = 0; i < tp->num_slots; i++) {
+       for (i = 0; i < tp->ntouches; i++) {
                t = &tp->touches[i];
                if (tp_touch_active(tp, t)) {
                        touches[n++] = t;