Bugfix: Correctly attach floating Cons to a different workspace, extend testcase

This commit is contained in:
Michael Stapelberg
2010-11-29 20:39:56 +01:00
parent 613866dbc0
commit 0f0d01336b
2 changed files with 42 additions and 15 deletions

View File

@ -106,22 +106,27 @@ void con_attach(Con *con, Con *parent, bool ignore_focus) {
goto add_to_focus_head;
}
if (!ignore_focus) {
/* Get the first tiling container in focus stack */
TAILQ_FOREACH(loop, &(parent->focus_head), focused) {
if (loop->type == CT_FLOATING_CON)
continue;
current = loop;
break;
if (con->type == CT_FLOATING_CON) {
DLOG("Inserting into floating containers\n");
TAILQ_INSERT_TAIL(&(parent->floating_head), con, floating_windows);
} else {
if (!ignore_focus) {
/* Get the first tiling container in focus stack */
TAILQ_FOREACH(loop, &(parent->focus_head), focused) {
if (loop->type == CT_FLOATING_CON)
continue;
current = loop;
break;
}
}
}
/* Insert the container after the tiling container, if found */
if (current) {
DLOG("Inserting con = %p after last focused tiling con %p\n",
con, current);
TAILQ_INSERT_AFTER(nodes_head, current, con, nodes);
} else TAILQ_INSERT_TAIL(nodes_head, con, nodes);
/* Insert the container after the tiling container, if found */
if (current) {
DLOG("Inserting con = %p after last focused tiling con %p\n",
con, current);
TAILQ_INSERT_AFTER(nodes_head, current, con, nodes);
} else TAILQ_INSERT_TAIL(nodes_head, con, nodes);
}
add_to_focus_head:
/* We insert to the TAIL because con_focus() will correct this.