Merge pull request #2413 from RyanDwyer/dont-move-empty-workspace

Deny "move container" when an empty workspace is focused
This commit is contained in:
emersion 2018-08-03 09:45:24 +01:00 committed by GitHub
commit 942f92f3eb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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",