tools: don't call is_cancelled on a gesture begin event
authorPeter Hutterer <peter.hutterer@who-t.net>
Mon, 6 Jul 2015 05:05:32 +0000 (15:05 +1000)
committerPeter Hutterer <peter.hutterer@who-t.net>
Mon, 6 Jul 2015 07:15:46 +0000 (17:15 +1000)
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
tools/event-debug.c

index 38ded5e..710a425 100644 (file)
@@ -307,7 +307,14 @@ print_gesture_event_without_coords(struct libinput_event *ev)
 {
        struct libinput_event_gesture *t = libinput_event_get_gesture_event(ev);
        int finger_count = libinput_event_gesture_get_finger_count(t);
-       int cancelled = libinput_event_gesture_get_cancelled(t);
+       int cancelled = 0;
+       enum libinput_event_type type;
+
+       type = libinput_event_get_type(ev);
+
+       if (type == LIBINPUT_EVENT_GESTURE_SWIPE_END ||
+           type == LIBINPUT_EVENT_GESTURE_PINCH_END)
+           cancelled = libinput_event_gesture_get_cancelled(t);
 
        print_event_time(libinput_event_gesture_get_time(t));
        printf("%d%s\n", finger_count, cancelled ? " cancelled" : "");