Skip to content

Commit

Permalink
Remove CSD from toggle list if client doesn't support it
Browse files Browse the repository at this point in the history
  • Loading branch information
RyanDwyer committed Sep 25, 2018
1 parent 78f8b55 commit 44222c1
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion sway/commands/border.c
Original file line number Diff line number Diff line change
Expand Up @@ -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>' "
Expand Down

0 comments on commit 44222c1

Please sign in to comment.