aboutsummaryrefslogtreecommitdiff
path: root/sway
diff options
context:
space:
mode:
authorRyan Dwyer <ryandwyer1@gmail.com>2018-08-03 17:13:37 +1000
committerRyan Dwyer <ryandwyer1@gmail.com>2018-08-03 17:13:37 +1000
commit9e8d628a17f4681e27da227a8daec3628678ad26 (patch)
treef2790e18e5f7d96c1ba2943906baf09f670e0576 /sway
parent5ac3509d546ee2e585ecb58aeea94ff9f3e8259d (diff)
Deny "move container" when an empty workspace is focused
Diffstat (limited to 'sway')
-rw-r--r--sway/commands/move.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/sway/commands/move.c b/sway/commands/move.c
index 702b42d9..1e8b76f9 100644
--- a/sway/commands/move.c
+++ b/sway/commands/move.c
@@ -59,6 +59,10 @@ static struct cmd_results *cmd_move_container(struct sway_container *current,
&& strcasecmp(argv[2], "workspace") == 0) {
// move container to workspace x
if (current->type == C_WORKSPACE) {
+ if (current->children->length == 0) {
+ return cmd_results_new(CMD_FAILURE, "move",
+ "Can't move an empty workspace");
+ }
current = container_wrap_children(current);
} else if (current->type != C_CONTAINER && current->type != C_VIEW) {
return cmd_results_new(CMD_FAILURE, "move",