Always add to the focus list, fixes crash.
This commit is contained in:
parent
77d0d42ed2
commit
2faac65237
22
src/con.c
22
src/con.c
@ -85,19 +85,19 @@ void con_attach(Con *con, Con *parent) {
|
|||||||
if (con->num < current->num) {
|
if (con->num < current->num) {
|
||||||
/* we need to insert the container at the beginning */
|
/* we need to insert the container at the beginning */
|
||||||
TAILQ_INSERT_HEAD(nodes_head, con, nodes);
|
TAILQ_INSERT_HEAD(nodes_head, con, nodes);
|
||||||
return;
|
} else {
|
||||||
}
|
while (current->num != -1 && con->num > current->num) {
|
||||||
while (current->num != -1 && con->num > current->num) {
|
current = TAILQ_NEXT(current, nodes);
|
||||||
current = TAILQ_NEXT(current, nodes);
|
if (current == TAILQ_END(nodes_head)) {
|
||||||
if (current == TAILQ_END(nodes_head)) {
|
current = NULL;
|
||||||
current = NULL;
|
break;
|
||||||
break;
|
}
|
||||||
}
|
}
|
||||||
|
/* we need to insert con after current, if current is not NULL */
|
||||||
|
if (current)
|
||||||
|
TAILQ_INSERT_BEFORE(current, con, nodes);
|
||||||
|
else TAILQ_INSERT_TAIL(nodes_head, con, nodes);
|
||||||
}
|
}
|
||||||
/* we need to insert con after current, if current is not NULL */
|
|
||||||
if (current)
|
|
||||||
TAILQ_INSERT_BEFORE(current, con, nodes);
|
|
||||||
else TAILQ_INSERT_TAIL(nodes_head, con, nodes);
|
|
||||||
}
|
}
|
||||||
goto add_to_focus_head;
|
goto add_to_focus_head;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user