summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2017-07-25 09:38:46 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2017-07-27 19:00:43 +1000
commit6bb05c594a73cee2ed9cf62af88fdcab4011f57a (patch)
tree722299f95acbd886cb981cbc0b7299c08c56e07f /src
parent55d1bb1217388e99b9405654c14881a9ebf8f880 (diff)
lid: disable all types but EV_SYN and EV_SW
The lid dispatch interface is a one-trick pony and can only handle SW_LID. It ignores other switches but crashes on any event type other than EV_SW and EV_SYN. Disable those types so we just ignore the event instead of asserting. https://bugs.freedesktop.org/show_bug.cgi?id=101853 Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Jason Gerecke <jason.gerecke@wacom.com>
Diffstat (limited to 'src')
-rw-r--r--src/evdev-lid.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/evdev-lid.c b/src/evdev-lid.c
index b3df37c2..6c438e00 100644
--- a/src/evdev-lid.c
+++ b/src/evdev-lid.c
@@ -298,6 +298,7 @@ struct evdev_dispatch *
evdev_lid_switch_dispatch_create(struct evdev_device *lid_device)
{
struct lid_switch_dispatch *dispatch;
+ int type;
dispatch = zalloc(sizeof *dispatch);
dispatch->base.dispatch_type = DISPATCH_LID_SWITCH;
@@ -309,5 +310,12 @@ evdev_lid_switch_dispatch_create(struct evdev_device *lid_device)
dispatch->lid_is_closed = false;
+ for (type = EV_KEY; type < EV_CNT; type++) {
+ if (type == EV_SW)
+ continue;
+
+ libevdev_disable_event_type(lid_device->evdev, type);
+ }
+
return &dispatch->base;
}