summaryrefslogtreecommitdiff
path: root/src/libinput.c
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2015-06-09 14:23:07 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2015-07-06 14:09:33 +1000
commita29155c9cb9d0decd56518c9cf6d2ede34264ae6 (patch)
tree00ca8d05276dac3261680db271c6682447372154 /src/libinput.c
parent9b938d65910b31dde8e405e599e7e7da21c7b174 (diff)
gestures: allow any gesture event type for gesture_get_dx/dy and get_angle
For start/end, dx/dy is always 0.0, and there is no need to make calling this function for start/end a caller bug. It just unnecessarily complicates the caller's codepath. Same for get_angle Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Diffstat (limited to 'src/libinput.c')
-rw-r--r--src/libinput.c28
1 files changed, 23 insertions, 5 deletions
diff --git a/src/libinput.c b/src/libinput.c
index 93a6eb8..563ad0d 100644
--- a/src/libinput.c
+++ b/src/libinput.c
@@ -714,8 +714,12 @@ libinput_event_gesture_get_dx(struct libinput_event_gesture *event)
require_event_type(libinput_event_get_context(&event->base),
event->base.type,
0.0,
+ LIBINPUT_EVENT_GESTURE_PINCH_BEGIN,
LIBINPUT_EVENT_GESTURE_PINCH_UPDATE,
- LIBINPUT_EVENT_GESTURE_SWIPE_UPDATE);
+ LIBINPUT_EVENT_GESTURE_PINCH_END,
+ LIBINPUT_EVENT_GESTURE_SWIPE_BEGIN,
+ LIBINPUT_EVENT_GESTURE_SWIPE_UPDATE,
+ LIBINPUT_EVENT_GESTURE_SWIPE_END);
return event->delta.x;
}
@@ -726,8 +730,12 @@ libinput_event_gesture_get_dy(struct libinput_event_gesture *event)
require_event_type(libinput_event_get_context(&event->base),
event->base.type,
0.0,
+ LIBINPUT_EVENT_GESTURE_PINCH_BEGIN,
LIBINPUT_EVENT_GESTURE_PINCH_UPDATE,
- LIBINPUT_EVENT_GESTURE_SWIPE_UPDATE);
+ LIBINPUT_EVENT_GESTURE_PINCH_END,
+ LIBINPUT_EVENT_GESTURE_SWIPE_BEGIN,
+ LIBINPUT_EVENT_GESTURE_SWIPE_UPDATE,
+ LIBINPUT_EVENT_GESTURE_SWIPE_END);
return event->delta.y;
}
@@ -739,8 +747,12 @@ libinput_event_gesture_get_dx_unaccelerated(
require_event_type(libinput_event_get_context(&event->base),
event->base.type,
0.0,
+ LIBINPUT_EVENT_GESTURE_PINCH_BEGIN,
LIBINPUT_EVENT_GESTURE_PINCH_UPDATE,
- LIBINPUT_EVENT_GESTURE_SWIPE_UPDATE);
+ LIBINPUT_EVENT_GESTURE_PINCH_END,
+ LIBINPUT_EVENT_GESTURE_SWIPE_BEGIN,
+ LIBINPUT_EVENT_GESTURE_SWIPE_UPDATE,
+ LIBINPUT_EVENT_GESTURE_SWIPE_END);
return event->delta_unaccel.x;
}
@@ -752,8 +764,12 @@ libinput_event_gesture_get_dy_unaccelerated(
require_event_type(libinput_event_get_context(&event->base),
event->base.type,
0.0,
+ LIBINPUT_EVENT_GESTURE_PINCH_BEGIN,
LIBINPUT_EVENT_GESTURE_PINCH_UPDATE,
- LIBINPUT_EVENT_GESTURE_SWIPE_UPDATE);
+ LIBINPUT_EVENT_GESTURE_PINCH_END,
+ LIBINPUT_EVENT_GESTURE_SWIPE_BEGIN,
+ LIBINPUT_EVENT_GESTURE_SWIPE_UPDATE,
+ LIBINPUT_EVENT_GESTURE_SWIPE_END);
return event->delta_unaccel.y;
}
@@ -777,7 +793,9 @@ libinput_event_gesture_get_angle_delta(struct libinput_event_gesture *event)
require_event_type(libinput_event_get_context(&event->base),
event->base.type,
0.0,
- LIBINPUT_EVENT_GESTURE_PINCH_UPDATE);
+ LIBINPUT_EVENT_GESTURE_PINCH_BEGIN,
+ LIBINPUT_EVENT_GESTURE_PINCH_UPDATE,
+ LIBINPUT_EVENT_GESTURE_PINCH_END);
return event->angle;
}