diff options
author | Peter Hutterer <peter.hutterer@who-t.net> | 2018-06-29 13:43:15 +1000 |
---|---|---|
committer | Peter Hutterer <peter.hutterer@who-t.net> | 2018-06-29 13:52:17 +1000 |
commit | 1f3f681fa70a04b80a87011a24cb6e2b827ab231 (patch) | |
tree | 9c09c5a947b1274425d3d44aa257de4d8957cb80 /src/evdev-fallback.c | |
parent | 1ec17d5e2a579f9162ecd5d2b700046599042bef (diff) | |
download | libinput-1f3f681fa70a04b80a87011a24cb6e2b827ab231.tar.gz |
fallback: cancel the debounce timers during device remove, not destroy
destroy isn't called until the last libinput_device_unref(), so we may trigger
a debounce timer after the device was removed. The same fix is neded for the
touchpad interface.
Fixes https://gitlab.freedesktop.org/libinput/libinput/issues/72
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Diffstat (limited to 'src/evdev-fallback.c')
-rw-r--r-- | src/evdev-fallback.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/evdev-fallback.c b/src/evdev-fallback.c index 7dad0fce..22dfb1b6 100644 --- a/src/evdev-fallback.c +++ b/src/evdev-fallback.c @@ -1012,6 +1012,9 @@ fallback_interface_remove(struct evdev_dispatch *evdev_dispatch) struct fallback_dispatch *dispatch = fallback_dispatch(evdev_dispatch); struct evdev_paired_keyboard *kbd, *tmp; + libinput_timer_cancel(&dispatch->debounce.timer); + libinput_timer_cancel(&dispatch->debounce.timer_short); + libinput_device_remove_event_listener(&dispatch->tablet_mode.other.listener); list_for_each_safe(kbd, @@ -1081,10 +1084,9 @@ fallback_interface_destroy(struct evdev_dispatch *evdev_dispatch) { struct fallback_dispatch *dispatch = fallback_dispatch(evdev_dispatch); - libinput_timer_cancel(&dispatch->debounce.timer); libinput_timer_destroy(&dispatch->debounce.timer); - libinput_timer_cancel(&dispatch->debounce.timer_short); libinput_timer_destroy(&dispatch->debounce.timer_short); + free(dispatch->mt.slots); free(dispatch); } |