aboutsummaryrefslogtreecommitdiff
path: root/sway/commands/border.c
diff options
context:
space:
mode:
authorRyan Dwyer <ryandwyer1@gmail.com>2018-09-25 19:34:53 +1000
committerRyan Dwyer <ryandwyer1@gmail.com>2018-09-27 22:51:37 +1000
commitefcfe57b1072283c94a74d074f0e38efc3b57af8 (patch)
tree2a9008adaa0b60b40cc908ee11773b5e15bbe7a1 /sway/commands/border.c
parent7b138e5ef0f679c9bb0078019d7c9c63fef36273 (diff)
Remove CSD from toggle list if client doesn't support it
Diffstat (limited to 'sway/commands/border.c')
-rw-r--r--sway/commands/border.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/sway/commands/border.c b/sway/commands/border.c
index 673fea08..5e101564 100644
--- a/sway/commands/border.c
+++ b/sway/commands/border.c
@@ -38,9 +38,14 @@ struct cmd_results *cmd_border(int argc, char **argv) {
} else if (strcmp(argv[0], "pixel") == 0) {
set_border(view, B_PIXEL);
} else if (strcmp(argv[0], "csd") == 0) {
+ if (!view->xdg_decoration) {
+ return cmd_results_new(CMD_INVALID, "border",
+ "This window doesn't support client side decorations");
+ }
set_border(view, B_CSD);
} else if (strcmp(argv[0], "toggle") == 0) {
- set_border(view, (view->border + 1) % 4);
+ int num_available = view->xdg_decoration ? 4 : 3;
+ set_border(view, (view->border + 1) % num_available);
} else {
return cmd_results_new(CMD_INVALID, "border",
"Expected 'border <none|normal|pixel|toggle>' "