[PATCH libinput 2/3] tablet: allow checking for proximity state on all tablet events

Peter Hutterer peter.hutterer at who-t.net
Sun Nov 15 15:31:40 PST 2015


By definition, the state is always proximity in on other events but let's
allow the call to be made anyway.

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 ed9490f..a2a98cc 100644
--- a/src/libinput.c
+++ b/src/libinput.c
@@ -1081,6 +1081,9 @@ libinput_event_tablet_get_proximity_state(struct libinput_event_tablet *event)
 	require_event_type(libinput_event_get_context(&event->base),
 			   event->base.type,
 			   0,
+			   LIBINPUT_EVENT_TABLET_AXIS,
+			   LIBINPUT_EVENT_TABLET_TIP,
+			   LIBINPUT_EVENT_TABLET_BUTTON,
 			   LIBINPUT_EVENT_TABLET_PROXIMITY);
 
 	return event->proximity_state;
@@ -1981,6 +1984,7 @@ tablet_notify_axis(struct libinput_device *device,
 	*axis_event = (struct libinput_event_tablet) {
 		.time = time,
 		.tool = tool,
+		.proximity_state = LIBINPUT_TOOL_PROXIMITY_IN,
 	};
 
 	memcpy(axis_event->changed_axes,
@@ -2049,6 +2053,7 @@ tablet_notify_tip(struct libinput_device *device,
 		.time = time,
 		.tool = tool,
 		.tip_state = tip_state,
+		.proximity_state = LIBINPUT_TOOL_PROXIMITY_IN,
 	};
 	memcpy(tip_event->axes,
 	       axes,
@@ -2085,6 +2090,7 @@ tablet_notify_button(struct libinput_device *device,
 		.button = button,
 		.state = state,
 		.seat_button_count = seat_button_count,
+		.proximity_state = LIBINPUT_TOOL_PROXIMITY_IN,
 	};
 	memcpy(button_event->axes, axes, sizeof(button_event->axes));
 
-- 
2.4.3



More information about the wayland-devel mailing list