[PATCH libinput 3/6] tablet: restrict tablet_axis_has_changed to axis/proximity events

Peter Hutterer peter.hutterer at who-t.net
Thu Nov 5 20:55:30 PST 2015


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

diff --git a/src/libinput.c b/src/libinput.c
index c1f2700..e384d8d 100644
--- a/src/libinput.c
+++ b/src/libinput.c
@@ -914,6 +914,12 @@ LIBINPUT_EXPORT int
 libinput_event_tablet_axis_has_changed(struct libinput_event_tablet *event,
 				       enum libinput_tablet_axis axis)
 {
+	require_event_type(libinput_event_get_context(&event->base),
+			   event->base.type,
+			   0,
+			   LIBINPUT_EVENT_TABLET_AXIS,
+			   LIBINPUT_EVENT_TABLET_PROXIMITY);
+
 	return (NCHARS(axis) <= sizeof(event->changed_axes)) ?
 		bit_is_set(event->changed_axes, axis) : 0;
 }
-- 
2.4.3



More information about the wayland-devel mailing list