keyboard: only update LEDs when changed

This commit is contained in:
xiliuya 2022-11-19 14:52:31 +08:00 committed by Simon Ser
parent caaea01bf6
commit 7f6d646e0a
2 changed files with 7 additions and 0 deletions

View file

@ -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);
}