diff options
author | Ryan Dwyer <ryandwyer1@gmail.com> | 2018-08-03 17:13:37 +1000 |
---|---|---|
committer | Ryan Dwyer <ryandwyer1@gmail.com> | 2018-08-03 17:13:37 +1000 |
commit | 9e8d628a17f4681e27da227a8daec3628678ad26 (patch) | |
tree | f2790e18e5f7d96c1ba2943906baf09f670e0576 | |
parent | Merge pull request #2408 from ianyfan/exit-nag (diff) | |
download | sway-9e8d628a17f4681e27da227a8daec3628678ad26.tar.gz sway-9e8d628a17f4681e27da227a8daec3628678ad26.tar.zst sway-9e8d628a17f4681e27da227a8daec3628678ad26.zip |
Deny "move container" when an empty workspace is focused
-rw-r--r-- | sway/commands/move.c | 4 |
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, | |||
59 | && strcasecmp(argv[2], "workspace") == 0) { | 59 | && strcasecmp(argv[2], "workspace") == 0) { |
60 | // move container to workspace x | 60 | // move container to workspace x |
61 | if (current->type == C_WORKSPACE) { | 61 | if (current->type == C_WORKSPACE) { |
62 | if (current->children->length == 0) { | ||
63 | return cmd_results_new(CMD_FAILURE, "move", | ||
64 | "Can't move an empty workspace"); | ||
65 | } | ||
62 | current = container_wrap_children(current); | 66 | current = container_wrap_children(current); |
63 | } else if (current->type != C_CONTAINER && current->type != C_VIEW) { | 67 | } else if (current->type != C_CONTAINER && current->type != C_VIEW) { |
64 | return cmd_results_new(CMD_FAILURE, "move", | 68 | return cmd_results_new(CMD_FAILURE, "move", |