summaryrefslogtreecommitdiffstats
path: root/sway/commands/input/left_handed.c
diff options
context:
space:
mode:
Diffstat (limited to 'sway/commands/input/left_handed.c')
-rw-r--r--sway/commands/input/left_handed.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/sway/commands/input/left_handed.c b/sway/commands/input/left_handed.c
index e770043a..2e0f757b 100644
--- a/sway/commands/input/left_handed.c
+++ b/sway/commands/input/left_handed.c
@@ -10,17 +10,13 @@ struct cmd_results *input_cmd_left_handed(int argc, char **argv) {
10 if ((error = checkarg(argc, "left_handed", EXPECTED_AT_LEAST, 1))) { 10 if ((error = checkarg(argc, "left_handed", EXPECTED_AT_LEAST, 1))) {
11 return error; 11 return error;
12 } 12 }
13 struct input_config *current_input_config = 13 struct input_config *ic = config->handler_context.input_config;
14 config->handler_context.input_config; 14 if (!ic) {
15 if (!current_input_config) {
16 return cmd_results_new(CMD_FAILURE, "left_handed", 15 return cmd_results_new(CMD_FAILURE, "left_handed",
17 "No input device defined."); 16 "No input device defined.");
18 } 17 }
19 struct input_config *new_config =
20 new_input_config(current_input_config->identifier);
21 18
22 new_config->left_handed = parse_boolean(argv[0], true); 19 ic->left_handed = parse_boolean(argv[0], true);
23 20
24 apply_input_config(new_config);
25 return cmd_results_new(CMD_SUCCESS, NULL, NULL); 21 return cmd_results_new(CMD_SUCCESS, NULL, NULL);
26} 22}