[PATCH libinput 3/4] Add missing event type checks to libinput_event_gesture_get_base_event

Peter Hutterer peter.hutterer at who-t.net
Fri Oct 28 05:41:28 UTC 2016


Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
---
 src/libinput.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/src/libinput.c b/src/libinput.c
index 6ad497e..1e97ad1 100644
--- a/src/libinput.c
+++ b/src/libinput.c
@@ -3032,6 +3032,16 @@ libinput_event_touch_get_base_event(struct libinput_event_touch *event)
 LIBINPUT_EXPORT struct libinput_event *
 libinput_event_gesture_get_base_event(struct libinput_event_gesture *event)
 {
+	require_event_type(libinput_event_get_context(&event->base),
+			   event->base.type,
+			   NULL,
+			   LIBINPUT_EVENT_GESTURE_SWIPE_BEGIN,
+			   LIBINPUT_EVENT_GESTURE_SWIPE_UPDATE,
+			   LIBINPUT_EVENT_GESTURE_SWIPE_END,
+			   LIBINPUT_EVENT_GESTURE_PINCH_BEGIN,
+			   LIBINPUT_EVENT_GESTURE_PINCH_UPDATE,
+			   LIBINPUT_EVENT_GESTURE_PINCH_END);
+
 	return &event->base;
 }
 
-- 
2.9.3



More information about the wayland-devel mailing list