Bugfix: also close empty split containers when the clients are moved away (Thanks mseed)

Also update the testcase (which used only 'kill' before).
This commit is contained in:
Michael Stapelberg
2011-01-20 10:09:43 +01:00
parent 3fe4146e24
commit 1fecbb3e5a
2 changed files with 51 additions and 1 deletions

View File

@ -478,11 +478,21 @@ void con_move_to_workspace(Con *con, Con *workspace) {
DLOG("Re-attaching container to %p / %s\n", next, next->name);
/* 5: re-attach the con to the parent of this focused container */
Con *parent = con->parent;
con_detach(con);
con_attach(con, next, false);
/* 6: keep focus on the current workspace */
con_focus(focus_next);
/* 7: check if the parent container is empty now and close it */
if (parent->type != CT_WORKSPACE &&
TAILQ_EMPTY(&(parent->nodes_head))) {
DLOG("Closing empty parent container\n");
/* TODO: check if this container would swallow any other client and
* dont close it automatically. */
tree_close(parent, false, false);
}
}
/*