From d328c2439c47fbbb24f74fd26e1a88ad8aaa3ace Mon Sep 17 00:00:00 2001 From: Tudor Brindus Date: Sun, 14 Jun 2020 17:21:38 -0400 Subject: input/pointer: don't trigger pointer bindings for emulated input Prior to this commit, a tablet device could trigger mouse button down bindings if the pen was pressed on a surface that didn't bind tablet handlers -- but it wouldn't if the surface did bind tablet handlers. We should expose consistent behavior to users so that they don't have to care about emulated vs. non-emulated input, so stop triggering bindings for any non-pointer devices. --- sway/input/cursor.c | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) (limited to 'sway/input') diff --git a/sway/input/cursor.c b/sway/input/cursor.c index f4ac74b4..d10ba444 100644 --- a/sway/input/cursor.c +++ b/sway/input/cursor.c @@ -256,21 +256,21 @@ int cursor_get_timeout(struct sway_cursor *cursor) { static enum sway_input_idle_source idle_source_from_device( struct wlr_input_device *device) { switch (device->type) { - case WLR_INPUT_DEVICE_KEYBOARD: - return IDLE_SOURCE_KEYBOARD; - case WLR_INPUT_DEVICE_POINTER: - return IDLE_SOURCE_POINTER; - case WLR_INPUT_DEVICE_TOUCH: - return IDLE_SOURCE_TOUCH; - case WLR_INPUT_DEVICE_TABLET_TOOL: - return IDLE_SOURCE_TABLET_TOOL; - case WLR_INPUT_DEVICE_TABLET_PAD: - return IDLE_SOURCE_TABLET_PAD; - case WLR_INPUT_DEVICE_SWITCH: - return IDLE_SOURCE_SWITCH; - } - - assert(false); + case WLR_INPUT_DEVICE_KEYBOARD: + return IDLE_SOURCE_KEYBOARD; + case WLR_INPUT_DEVICE_POINTER: + return IDLE_SOURCE_POINTER; + case WLR_INPUT_DEVICE_TOUCH: + return IDLE_SOURCE_TOUCH; + case WLR_INPUT_DEVICE_TABLET_TOOL: + return IDLE_SOURCE_TABLET_TOOL; + case WLR_INPUT_DEVICE_TABLET_PAD: + return IDLE_SOURCE_TABLET_PAD; + case WLR_INPUT_DEVICE_SWITCH: + return IDLE_SOURCE_SWITCH; + } + + abort(); } void cursor_handle_activity(struct sway_cursor *cursor, -- cgit v1.2.3-54-g00ecf