diff options
author | Brian Ashworth <RedSoxFan@users.noreply.github.com> | 2018-07-16 22:21:00 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-07-16 22:21:00 -0400 |
commit | f516dbfb6d3380de24751de9a3f3156ece869e02 (patch) | |
tree | fb23163603e5ac4221d6ee27ff91dffb19e3295f /sway/commands | |
parent | db3a36373435a34b8d0a5fc4e90eacaa2b1dae6b (diff) | |
parent | 10fc7a5b494822a944bbada33b2cb25926447d76 (diff) | |
download | sway-f516dbfb6d3380de24751de9a3f3156ece869e02.tar.xz |
Merge pull request #2286 from RyanDwyer/default-floating-border
Implement default_floating_border command and adjust CSD behaviour
Diffstat (limited to 'sway/commands')
-rw-r--r-- | sway/commands/default_floating_border.c | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/sway/commands/default_floating_border.c b/sway/commands/default_floating_border.c new file mode 100644 index 00000000..1bfc24af --- /dev/null +++ b/sway/commands/default_floating_border.c @@ -0,0 +1,29 @@ +#include "log.h" +#include "sway/commands.h" +#include "sway/config.h" +#include "sway/tree/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 (strcmp(argv[0], "none") == 0) { + config->floating_border = B_NONE; + } else if (strcmp(argv[0], "normal") == 0) { + config->floating_border = B_NORMAL; + } else if (strcmp(argv[0], "pixel") == 0) { + config->floating_border = B_PIXEL; + } else { + return cmd_results_new(CMD_INVALID, "default_floating_border", + "Expected 'default_floating_border <none|normal|pixel>' " + "or 'default_floating_border <normal|pixel> <px>'"); + } + if (argc == 2) { + config->floating_border_thickness = atoi(argv[1]); + } + + return cmd_results_new(CMD_SUCCESS, NULL, NULL); +} |