Update leds when devices are added

This fixes #1104

LEDs on keyboard will now update to match the
compositor state when they're plugged in.
This commit is contained in:
Paul Daniel Faria 2025-01-01 08:48:32 -08:00 committed by Victoria Brekenfeld
parent 68b6156aa8
commit e5263bbad8
2 changed files with 10 additions and 3 deletions

View file

@ -171,7 +171,8 @@ impl State {
InputEvent::DeviceAdded { device } => {
let shell = self.common.shell.read().unwrap();
let seat = shell.seats.last_active();
seat.devices().add_device(&device);
let led_state = seat.get_keyboard().unwrap().led_state();
seat.devices().add_device(&device, led_state);
if device.has_capability(DeviceCapability::TabletTool) {
seat.tablet_seat().add_tablet::<Self>(
&self.common.display_handle,