Bugfix: Correctly revert focus to other floating windows when closing a floating window

Uncovered by the testsuite \o/
This commit is contained in:
Michael Stapelberg
2011-09-21 23:28:01 +01:00
parent 67aab7c8bd
commit 4dbda73114
8 changed files with 28 additions and 14 deletions

View File

@ -91,7 +91,7 @@ void floating_enable(Con *con, bool automatic) {
/* check if the parent container is empty and close it if so */
if ((con->parent->type == CT_CON || con->parent->type == CT_FLOATING_CON) && con_num_children(con->parent) == 0) {
DLOG("Old container empty after setting this child to floating, closing\n");
tree_close(con->parent, DONT_KILL_WINDOW, false);
tree_close(con->parent, DONT_KILL_WINDOW, false, false);
}
char *name;
@ -212,7 +212,7 @@ void floating_disable(Con *con, bool automatic) {
/* 2: kill parent container */
TAILQ_REMOVE(&(con->parent->parent->floating_head), con->parent, floating_windows);
TAILQ_REMOVE(&(con->parent->parent->focus_head), con->parent, focused);
tree_close(con->parent, DONT_KILL_WINDOW, false);
tree_close(con->parent, DONT_KILL_WINDOW, false, false);
/* 3: re-attach to the parent of the currently focused con on the workspace
* this floating con was on */