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