1 #include <string.h> 2 #include "sway/commands.h" 3 #include "sway/config.h" 4 #include "log.h" 5 cmd_tiling_drag_threshold(int argc,char ** argv)6struct cmd_results *cmd_tiling_drag_threshold(int argc, char **argv) { 7 struct cmd_results *error = NULL; 8 if ((error = checkarg(argc, "tiling_drag_threshold", EXPECTED_EQUAL_TO, 1))) { 9 return error; 10 } 11 12 char *inv; 13 int value = strtol(argv[0], &inv, 10); 14 if (*inv != '\0' || value < 0) { 15 return cmd_results_new(CMD_INVALID, "Invalid threshold specified"); 16 } 17 18 config->tiling_drag_threshold = value; 19 20 return cmd_results_new(CMD_SUCCESS, NULL); 21 } 22