summaryrefslogtreecommitdiff
path: root/sway/commands/default_floating_border.c
diff options
context:
space:
mode:
authorDrew DeVault <[email protected]>2018-04-12 20:19:54 -0400
committerDrew DeVault <[email protected]>2018-04-12 20:19:54 -0400
commitcd1b32453a9296c18b28bff71607aeb22987b5cd (patch)
treec653c6d525b471914c01a9d7ae543f521b6138ed /sway/commands/default_floating_border.c
parent8e06985cc1b479724446fba752e0fecfb998e87b (diff)
parent5785170421dc38437acde8bb61068cd16fda716c (diff)
Merge branch 'wlroots'
Diffstat (limited to 'sway/commands/default_floating_border.c')
-rw-r--r--sway/commands/default_floating_border.c45
1 files changed, 0 insertions, 45 deletions
diff --git a/sway/commands/default_floating_border.c b/sway/commands/default_floating_border.c
deleted file mode 100644
index fb48c1c0..00000000
--- a/sway/commands/default_floating_border.c
+++ /dev/null
@@ -1,45 +0,0 @@
-#include <errno.h>
-#include <string.h>
-#include <strings.h>
-#include "sway/commands.h"
-#include "sway/container.h"
-
-struct cmd_results *cmd_default_floating_border(int argc, char **argv) {
- struct cmd_results *error = NULL;
- if ((error = checkarg(argc, "default_floating_border", EXPECTED_AT_LEAST, 1))) {
- return error;
- }
-
- if (argc > 2) {
- return cmd_results_new(CMD_INVALID, "default_floating_border",
- "Expected 'default_floating_border <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, "default_floating_border",
- "Expected 'default_floating_border <normal|none|pixel> [<n>]");
- }
-
- 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, "default_floating_border",
- "Number is out out of range.");
- }
- }
-
- config->floating_border = border;
- config->floating_border_thickness = thickness;
-
- return cmd_results_new(CMD_SUCCESS, NULL, NULL);
-}