1 #include <string.h>
2 #include <strings.h>
3 #include "sway/config.h"
4 #include "sway/commands.h"
5 #include "sway/input/input-manager.h"
6 #include "util.h"
7 
input_cmd_drag_lock(int argc,char ** argv)8 struct cmd_results *input_cmd_drag_lock(int argc, char **argv) {
9 	struct cmd_results *error = NULL;
10 	if ((error = checkarg(argc, "drag_lock", EXPECTED_AT_LEAST, 1))) {
11 		return error;
12 	}
13 	struct input_config *ic = config->handler_context.input_config;
14 	if (!ic) {
15 		return cmd_results_new(CMD_FAILURE, "No input device defined.");
16 	}
17 
18 	if (parse_boolean(argv[0], true)) {
19 		ic->drag_lock = LIBINPUT_CONFIG_DRAG_LOCK_ENABLED;
20 	} else {
21 		ic->drag_lock = LIBINPUT_CONFIG_DRAG_LOCK_DISABLED;
22 	}
23 
24 	return cmd_results_new(CMD_SUCCESS, NULL);
25 }
26