From 5f928dfeac25472bc4160eda4dc5e0103a14ad1e Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Thu, 12 Nov 2015 07:32:34 +1000 Subject: [PATCH] tablet: allow checking for proximity state on all tablet events 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 Reviewed-by: Hans de Goede --- src/libinput.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/libinput.c b/src/libinput.c index ed9490f6..a2a98cc6 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));