diff options
Diffstat (limited to 'sway/input')
-rw-r--r-- | sway/input/input-manager.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/sway/input/input-manager.c b/sway/input/input-manager.c index cfd39bab..3d7f9e8b 100644 --- a/sway/input/input-manager.c +++ b/sway/input/input-manager.c @@ -359,6 +359,23 @@ void input_manager_set_focus(struct sway_node *node) { } } +/** + * Re-translate keysyms if a change in the input config could affect them. + */ +static void retranslate_keysyms(struct input_config *input_config) { + for (int i = 0; i < config->input_configs->length; ++i) { + struct input_config *ic = config->input_configs->items[i]; + if (ic->xkb_layout || ic->xkb_file) { + // this is the first config with xkb_layout or xkb_file + if (ic->identifier == input_config->identifier) { + translate_keysyms(ic); + } + + return; + } + } +} + void input_manager_apply_input_config(struct input_config *input_config) { struct sway_input_device *input_device = NULL; bool wildcard = strcmp(input_config->identifier, "*") == 0; @@ -376,6 +393,8 @@ void input_manager_apply_input_config(struct input_config *input_config) { } } } + + retranslate_keysyms(input_config); } void input_manager_reset_input(struct sway_input_device *input_device) { |