From 9d1fdb0c6deacf11bfa2e32a56ff2ce0df2291c1 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Fri, 5 May 2017 12:48:35 +1000 Subject: touchpad: remove the lid switch listener on device_removed Sequence triggered by the xorg driver, but basically: if the touchpad is destroyed before the lid switch, the event listener wasn't removed and an assertion was triggered. Signed-off-by: Peter Hutterer --- src/evdev-mt-touchpad.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src') diff --git a/src/evdev-mt-touchpad.c b/src/evdev-mt-touchpad.c index 8140c44..e0757e1 100644 --- a/src/evdev-mt-touchpad.c +++ b/src/evdev-mt-touchpad.c @@ -1768,6 +1768,12 @@ tp_interface_device_removed(struct evdev_device *device, tp->dwt.keyboard = NULL; } + if (removed_device == tp->lid_switch.lid_switch) { + libinput_device_remove_event_listener( + &tp->lid_switch.lid_switch_listener); + tp->lid_switch.lid_switch = NULL; + } + if (tp->sendevents.current_mode != LIBINPUT_CONFIG_SEND_EVENTS_DISABLED_ON_EXTERNAL_MOUSE) return; -- cgit v1.2.3