Bugfix: Attach new cons at the correct place when a floating con is focused (+test) (Thanks fernandotcl)

New containers were previously attached directly to the workspace instead of to
the previously focused place in the workspace (for example a stacked con).

Fixes: #376
This commit is contained in:
Michael Stapelberg
2011-05-13 21:29:01 +02:00
parent 3d2cd6abaa
commit aea445b690
2 changed files with 51 additions and 3 deletions

View File

@ -66,9 +66,13 @@ Con *tree_open_con(Con *con) {
}
/* If the currently focused container is a floating container, we
* attach the new container to the workspace */
if (con->type == CT_FLOATING_CON)
con = con->parent;
* attach the new container to the currently focused spot in its
* workspace. */
if (con->type == CT_FLOATING_CON) {
con = con_descend_tiling_focused(con->parent);
if (con->type != CT_WORKSPACE)
con = con->parent;
}
DLOG("con = %p\n", con);
}