summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBenjamin Tissoires <benjamin.tissoires@gmail.com>2017-05-19 12:57:23 +0200
committerPeter Hutterer <peter.hutterer@who-t.net>2017-05-23 15:10:10 +1000
commit8fbdef3aadfaa09dfaec50b0f67ec43ad0b55e96 (patch)
tree8aa6ffb1cba5ce2eb2d539ccb5bd00d29c6d7035 /src
parent28fcd2c6d41e972f606c60f56c6f0a94d73455ae (diff)
lid: setup the keyboard notifier when pairing it
On unreliable LID switches, we might have the LID declared as closed while it is actually not. We can not wait for the first switch event to setup the keyboard listener: it will never occur. https://bugs.freedesktop.org/show_bug.cgi?id=101099 Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Diffstat (limited to 'src')
-rw-r--r--src/evdev-lid.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/evdev-lid.c b/src/evdev-lid.c
index 010cb42..fe98e6e 100644
--- a/src/evdev-lid.c
+++ b/src/evdev-lid.c
@@ -224,8 +224,11 @@ lid_switch_pair_keyboard(struct evdev_device *lid_switch,
lid_switch->devname,
keyboard->devname);
- /* We don't init the event listener yet - we don't care
- * about keyboard events until the lid is closed */
+ /* We need to init the event listener now only if the reported state
+ * is closed. */
+ if (dispatch->lid_is_closed)
+ lid_switch_toggle_keyboard_listener(dispatch,
+ dispatch->lid_is_closed);
}
}