summaryrefslogtreecommitdiff
path: root/src/devices/IKeyboard.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/devices/IKeyboard.cpp')
-rw-r--r--src/devices/IKeyboard.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/devices/IKeyboard.cpp b/src/devices/IKeyboard.cpp
index 3bd42eac..7e4dd912 100644
--- a/src/devices/IKeyboard.cpp
+++ b/src/devices/IKeyboard.cpp
@@ -131,8 +131,17 @@ void IKeyboard::updateLEDs() {
leds |= (1 << i);
}
+ updateLEDs(leds);
+}
+
+void IKeyboard::updateLEDs(uint32_t leds) {
+ auto keyboard = wlr();
+
+ if (!keyboard || keyboard->xkb_state == nullptr)
+ return;
+
if (isVirtual() && g_pInputManager->shouldIgnoreVirtualKeyboard(self.lock()))
return;
- wlr_keyboard_led_update(wlr(), leds);
+ wlr_keyboard_led_update(keyboard, leds);
}