diff options
-rw-r--r-- | include/wlr/types/wlr_keyboard.h | 1 | ||||
-rw-r--r-- | types/wlr_keyboard.c | 6 |
2 files changed, 7 insertions, 0 deletions
diff --git a/include/wlr/types/wlr_keyboard.h b/include/wlr/types/wlr_keyboard.h index d53d3c30..b1e01c4d 100644 --- a/include/wlr/types/wlr_keyboard.h +++ b/include/wlr/types/wlr_keyboard.h @@ -62,6 +62,7 @@ struct wlr_keyboard { xkb_led_index_t led_indexes[WLR_LED_COUNT]; xkb_mod_index_t mod_indexes[WLR_MODIFIER_COUNT]; + uint32_t leds; uint32_t keycodes[WLR_KEYBOARD_KEYS_CAP]; size_t num_keycodes; struct wlr_keyboard_modifiers modifiers; diff --git a/types/wlr_keyboard.c b/types/wlr_keyboard.c index 5150af87..b1084841 100644 --- a/types/wlr_keyboard.c +++ b/types/wlr_keyboard.c @@ -163,6 +163,12 @@ void wlr_keyboard_finish(struct wlr_keyboard *kb) { } void wlr_keyboard_led_update(struct wlr_keyboard *kb, uint32_t leds) { + if (kb->leds == leds) { + return; + } + + kb->leds = leds; + if (kb->impl && kb->impl->led_update) { kb->impl->led_update(kb, leds); } |