summaryrefslogtreecommitdiffstats
path: root/sway/commands/input/dwt.c
diff options
context:
space:
mode:
Diffstat (limited to 'sway/commands/input/dwt.c')
-rw-r--r--sway/commands/input/dwt.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/sway/commands/input/dwt.c b/sway/commands/input/dwt.c
index 15134268..0c3881dd 100644
--- a/sway/commands/input/dwt.c
+++ b/sway/commands/input/dwt.c
@@ -10,20 +10,16 @@ struct cmd_results *input_cmd_dwt(int argc, char **argv) {
10 if ((error = checkarg(argc, "dwt", EXPECTED_AT_LEAST, 1))) { 10 if ((error = checkarg(argc, "dwt", 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, "dwt", "No input device defined."); 15 return cmd_results_new(CMD_FAILURE, "dwt", "No input device defined.");
17 } 16 }
18 struct input_config *new_config =
19 new_input_config(current_input_config->identifier);
20 17
21 if (parse_boolean(argv[0], true)) { 18 if (parse_boolean(argv[0], true)) {
22 new_config->dwt = LIBINPUT_CONFIG_DWT_ENABLED; 19 ic->dwt = LIBINPUT_CONFIG_DWT_ENABLED;
23 } else { 20 } else {
24 new_config->dwt = LIBINPUT_CONFIG_DWT_DISABLED; 21 ic->dwt = LIBINPUT_CONFIG_DWT_DISABLED;
25 } 22 }
26 23
27 apply_input_config(new_config);
28 return cmd_results_new(CMD_SUCCESS, NULL, NULL); 24 return cmd_results_new(CMD_SUCCESS, NULL, NULL);
29} 25}