diff options
Diffstat (limited to 'sway/commands/input.c')
-rw-r--r-- | sway/commands/input.c | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/sway/commands/input.c b/sway/commands/input.c index 903d574f..2de07de6 100644 --- a/sway/commands/input.c +++ b/sway/commands/input.c | |||
@@ -43,24 +43,17 @@ static struct cmd_handler input_config_handlers[] = { | |||
43 | * Re-translate keysyms if a change in the input config could affect them. | 43 | * Re-translate keysyms if a change in the input config could affect them. |
44 | */ | 44 | */ |
45 | static void retranslate_keysyms(struct input_config *input_config) { | 45 | static void retranslate_keysyms(struct input_config *input_config) { |
46 | bool matched = false; | ||
47 | for (int i = 0; i < config->input_configs->length; ++i) { | 46 | for (int i = 0; i < config->input_configs->length; ++i) { |
48 | struct input_config *ic = config->input_configs->items[i]; | 47 | struct input_config *ic = config->input_configs->items[i]; |
49 | matched |= ic->identifier == input_config->identifier; | ||
50 | |||
51 | // the first configured xkb_layout | ||
52 | if (ic->xkb_layout) { | 48 | if (ic->xkb_layout) { |
53 | if (matched) { | 49 | // this is the first config with xkb_layout |
50 | if (ic->identifier == input_config->identifier) { | ||
54 | translate_keysyms(ic->xkb_layout); | 51 | translate_keysyms(ic->xkb_layout); |
55 | } | 52 | } |
56 | 53 | ||
57 | // nothing has changed | ||
58 | return; | 54 | return; |
59 | } | 55 | } |
60 | } | 56 | } |
61 | |||
62 | // no xkb_layout has been set, restore the default | ||
63 | translate_keysyms(getenv("XKB_DEFAULT_LAYOUT")); | ||
64 | } | 57 | } |
65 | 58 | ||
66 | struct cmd_results *cmd_input(int argc, char **argv) { | 59 | struct cmd_results *cmd_input(int argc, char **argv) { |