diff options
author | Tudor Brindus <me@tbrindus.ca> | 2020-06-14 17:21:38 -0400 |
---|---|---|
committer | Simon Ser <contact@emersion.fr> | 2020-06-18 22:35:01 +0200 |
commit | d328c2439c47fbbb24f74fd26e1a88ad8aaa3ace (patch) | |
tree | 3ad5263b2cc20e5bf2fe6e0352058e2db30993ce /sway/input/cursor.c | |
parent | input/cursor: send idle events based off device type, not input type (diff) | |
download | sway-d328c2439c47fbbb24f74fd26e1a88ad8aaa3ace.tar.gz sway-d328c2439c47fbbb24f74fd26e1a88ad8aaa3ace.tar.zst sway-d328c2439c47fbbb24f74fd26e1a88ad8aaa3ace.zip |
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.
Diffstat (limited to 'sway/input/cursor.c')
-rw-r--r-- | sway/input/cursor.c | 30 |
1 files changed, 15 insertions, 15 deletions
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) { | |||
256 | static enum sway_input_idle_source idle_source_from_device( | 256 | static enum sway_input_idle_source idle_source_from_device( |
257 | struct wlr_input_device *device) { | 257 | struct wlr_input_device *device) { |
258 | switch (device->type) { | 258 | switch (device->type) { |
259 | case WLR_INPUT_DEVICE_KEYBOARD: | 259 | case WLR_INPUT_DEVICE_KEYBOARD: |
260 | return IDLE_SOURCE_KEYBOARD; | 260 | return IDLE_SOURCE_KEYBOARD; |
261 | case WLR_INPUT_DEVICE_POINTER: | 261 | case WLR_INPUT_DEVICE_POINTER: |
262 | return IDLE_SOURCE_POINTER; | 262 | return IDLE_SOURCE_POINTER; |
263 | case WLR_INPUT_DEVICE_TOUCH: | 263 | case WLR_INPUT_DEVICE_TOUCH: |
264 | return IDLE_SOURCE_TOUCH; | 264 | return IDLE_SOURCE_TOUCH; |
265 | case WLR_INPUT_DEVICE_TABLET_TOOL: | 265 | case WLR_INPUT_DEVICE_TABLET_TOOL: |
266 | return IDLE_SOURCE_TABLET_TOOL; | 266 | return IDLE_SOURCE_TABLET_TOOL; |
267 | case WLR_INPUT_DEVICE_TABLET_PAD: | 267 | case WLR_INPUT_DEVICE_TABLET_PAD: |
268 | return IDLE_SOURCE_TABLET_PAD; | 268 | return IDLE_SOURCE_TABLET_PAD; |
269 | case WLR_INPUT_DEVICE_SWITCH: | 269 | case WLR_INPUT_DEVICE_SWITCH: |
270 | return IDLE_SOURCE_SWITCH; | 270 | return IDLE_SOURCE_SWITCH; |
271 | } | 271 | } |
272 | 272 | ||
273 | assert(false); | 273 | abort(); |
274 | } | 274 | } |
275 | 275 | ||
276 | void cursor_handle_activity(struct sway_cursor *cursor, | 276 | void cursor_handle_activity(struct sway_cursor *cursor, |