Implemented config key 'new_container'
This commit is contained in:
committed by
Michael Stapelberg
parent
21c7a69812
commit
650eebc347
12
src/con.c
12
src/con.c
@ -59,8 +59,16 @@ Con *con_new(Con *parent) {
|
||||
TAILQ_INIT(&(new->focus_head));
|
||||
TAILQ_INIT(&(new->swallow_head));
|
||||
|
||||
if (parent != NULL)
|
||||
con_attach(new, parent, false);
|
||||
if (parent != NULL) {
|
||||
/* Set layout of ws if this is the first child of the ws. */
|
||||
if (parent->type == CT_WORKSPACE && con_is_leaf(parent)) {
|
||||
con_set_layout(new, config.default_layout);
|
||||
con_attach(new, parent, false);
|
||||
con_set_layout(parent, config.default_layout);
|
||||
} else {
|
||||
con_attach(new, parent, false);
|
||||
}
|
||||
}
|
||||
|
||||
return new;
|
||||
}
|
||||
|
Reference in New Issue
Block a user