diff options
author | Drew DeVault <sir@cmpwn.com> | 2017-03-13 15:13:07 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-03-13 15:13:07 -0400 |
commit | 39ecc10553895ec9c7baf188452e3c80885bae0c (patch) | |
tree | 52cc52fb0ec42085c37bee5f4f2e5c5f10cf2631 /sway/commands/new_float.c | |
parent | 2e1083f52cbec40ed00df27dd1fb5b4d42d9254b (diff) | |
parent | b507462d1c66e11cce76e069a508621dc9599f07 (diff) | |
download | sway-39ecc10553895ec9c7baf188452e3c80885bae0c.tar.xz |
Merge pull request #1108 from zandrmartin/new-command-aliases
deprecate new_window and new_float commands
Diffstat (limited to 'sway/commands/new_float.c')
-rw-r--r-- | sway/commands/new_float.c | 44 |
1 files changed, 4 insertions, 40 deletions
diff --git a/sway/commands/new_float.c b/sway/commands/new_float.c index 432af436..d0f96093 100644 --- a/sway/commands/new_float.c +++ b/sway/commands/new_float.c @@ -1,44 +1,8 @@ -#include <errno.h> -#include <string.h> -#include <strings.h> +#include "log.h" #include "sway/commands.h" -#include "sway/container.h" struct cmd_results *cmd_new_float(int argc, char **argv) { - struct cmd_results *error = NULL; - if ((error = checkarg(argc, "new_float", EXPECTED_AT_LEAST, 1))) { - return error; - } - - if (argc > 2) { - return cmd_results_new(CMD_INVALID, "new_float", - "Expected 'new_float <normal|none|pixel> [<n>]"); - } - - enum swayc_border_types border = config->floating_border; - int thickness = config->floating_border_thickness; - - if (strcasecmp(argv[0], "none") == 0) { - border = B_NONE; - } else if (strcasecmp(argv[0], "normal") == 0) { - border = B_NORMAL; - } else if (strcasecmp(argv[0], "pixel") == 0) { - border = B_PIXEL; - } else { - return cmd_results_new(CMD_INVALID, "new_float", - "Expected 'border <normal|none|pixel>"); - } - - if (argc == 2 && (border == B_NORMAL || border == B_PIXEL)) { - thickness = (int)strtol(argv[1], NULL, 10); - if (errno == ERANGE || thickness < 0) { - errno = 0; - return cmd_results_new(CMD_INVALID, "new_float", "Number is out out of range."); - } - } - - config->floating_border = border; - config->floating_border_thickness = thickness; - - return cmd_results_new(CMD_SUCCESS, NULL, NULL); + sway_log(L_INFO, "`new_float` is deprecated and will be removed in the future. " + "Please use `default_floating_border` instead."); + return cmd_default_floating_border(argc, argv); } |