summaryrefslogtreecommitdiffstats
path: root/sway/commands/input/xkb_options.c
diff options
context:
space:
mode:
Diffstat (limited to 'sway/commands/input/xkb_options.c')
-rw-r--r--sway/commands/input/xkb_options.c17
1 files changed, 7 insertions, 10 deletions
diff --git a/sway/commands/input/xkb_options.c b/sway/commands/input/xkb_options.c
index 3059d941..794ab6e9 100644
--- a/sway/commands/input/xkb_options.c
+++ b/sway/commands/input/xkb_options.c
@@ -9,18 +9,15 @@ struct cmd_results *input_cmd_xkb_options(int argc, char **argv) {
9 if ((error = checkarg(argc, "xkb_options", EXPECTED_EQUAL_TO, 1))) { 9 if ((error = checkarg(argc, "xkb_options", EXPECTED_EQUAL_TO, 1))) {
10 return error; 10 return error;
11 } 11 }
12 struct input_config *current_input_config = 12 struct input_config *ic = config->handler_context.input_config;
13 config->handler_context.input_config; 13 if (!ic) {
14 if (!current_input_config) { 14 return cmd_results_new(CMD_FAILURE, "xkb_options",
15 return cmd_results_new(CMD_FAILURE, "xkb_options", "No input device defined."); 15 "No input device defined.");
16 } 16 }
17 struct input_config *new_config =
18 new_input_config(current_input_config->identifier);
19 17
20 new_config->xkb_options = strdup(argv[0]); 18 ic->xkb_options = strdup(argv[0]);
21 19
22 wlr_log(WLR_DEBUG, "apply-xkb_options for device: %s options: %s", 20 wlr_log(WLR_DEBUG, "set-xkb_options for config: %s options: %s",
23 current_input_config->identifier, new_config->xkb_options); 21 ic->identifier, ic->xkb_options);
24 apply_input_config(new_config);
25 return cmd_results_new(CMD_SUCCESS, NULL, NULL); 22 return cmd_results_new(CMD_SUCCESS, NULL, NULL);
26} 23}