From efcfe57b1072283c94a74d074f0e38efc3b57af8 Mon Sep 17 00:00:00 2001 From: Ryan Dwyer Date: Tue, 25 Sep 2018 19:34:53 +1000 Subject: [PATCH] Remove CSD from toggle list if client doesn't support it --- sway/commands/border.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/sway/commands/border.c b/sway/commands/border.c index 673fea08a..5e101564e 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 ' "