From 58a2faf7162e615c7dbb391ebae658cb36888f58 Mon Sep 17 00:00:00 2001 From: Samu Nuutamo Date: Mon, 29 Oct 2018 17:42:48 +0200 Subject: [PATCH] libinput-seat: update leds when a new device is added Fix an issue where the keyboard leds will go out of sync when a new keyboard is connected. The issue can be easily reproduced by connecting two keyboards, enabling caps lock, and reconnecting one of the keyboards. Without the patch the leds on both keyboards will turn off while the actual caps lock state will stay enabled. Signed-off-by: Samu Nuutamo --- libweston/libinput-seat.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/libweston/libinput-seat.c b/libweston/libinput-seat.c index 98015518..49fbc347 100644 --- a/libweston/libinput-seat.c +++ b/libweston/libinput-seat.c @@ -135,8 +135,13 @@ device_added(struct udev_input *input, struct libinput_device *libinput_device) evdev_device_set_output(device, output); } - if (!input->suspended) + if (!input->suspended) { weston_seat_repick(seat); + + /* Sync device leds with the actual state */ + if (seat->led_update && seat->keyboard_state) + seat->led_update(seat, seat->keyboard_state->xkb_state.leds); + } } static void