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 <samu.nuutamo@gmail.com>
This commit is contained in:
Samu Nuutamo 2018-10-29 17:42:48 +02:00 committed by Pekka Paalanen
parent 497d03edbf
commit 58a2faf716

View file

@ -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