aboutsummaryrefslogtreecommitdiffstats
path: root/sway/input/keyboard.c
diff options
context:
space:
mode:
authorLibravatar Kenny Levinsen <kl@kl.wtf>2022-12-04 01:20:06 +0100
committerLibravatar Simon Ser <contact@emersion.fr>2022-12-12 11:26:11 +0100
commit817f1bbec3cec1657d0e92714f883faa45a6fef7 (patch)
tree2209393661635bb54462db782ed1a8a4e0dd407c /sway/input/keyboard.c
parentbuild: bump version to 1.8-rc2 (diff)
downloadsway-817f1bbec3cec1657d0e92714f883faa45a6fef7.tar.gz
sway-817f1bbec3cec1657d0e92714f883faa45a6fef7.tar.zst
sway-817f1bbec3cec1657d0e92714f883faa45a6fef7.zip
seat: Avoid sending redundant keymaps on reload
When we reload the config, we reset every input device and re-apply configuration from the config file. This means that the keyboard keymap is updated at least once during config reload, more if the config file contains keyboard configuration. When they keyboard keymap changes and is updated through wlr_seat, the keymap ends up sent to every keyboard bound in every client, seemingly multiple times. On an x230 of mine with a keyboard layout set in the config file, I see 42 keymap events sent to foot on config reload. Reduce events from keyboard configurations by skipping all but the currently active keyboard for the seat, and by clearing the active keyboard during input manager device reset. After this change, I only see a single just-in-time keymap event. Fixes: https://github.com/swaywm/sway/issues/6654
Diffstat (limited to 'sway/input/keyboard.c')
-rw-r--r--sway/input/keyboard.c3
1 files changed, 0 insertions, 3 deletions
diff --git a/sway/input/keyboard.c b/sway/input/keyboard.c
index 5e5692f1..aedf3ae6 100644
--- a/sway/input/keyboard.c
+++ b/sway/input/keyboard.c
@@ -1068,9 +1068,6 @@ void sway_keyboard_configure(struct sway_keyboard *keyboard) {
1068 } 1068 }
1069 } 1069 }
1070 1070
1071 struct wlr_seat *seat = keyboard->seat_device->sway_seat->wlr_seat;
1072 wlr_seat_set_keyboard(seat, keyboard->wlr);
1073
1074 wl_list_remove(&keyboard->keyboard_key.link); 1071 wl_list_remove(&keyboard->keyboard_key.link);
1075 wl_signal_add(&keyboard->wlr->events.key, &keyboard->keyboard_key); 1072 wl_signal_add(&keyboard->wlr->events.key, &keyboard->keyboard_key);
1076 keyboard->keyboard_key.notify = handle_keyboard_key; 1073 keyboard->keyboard_key.notify = handle_keyboard_key;