sanity check: drop swallows for split containers (Thanks xeen)
fixes #1149
This commit is contained in:
parent
bb482e2869
commit
93cfdcd488
|
@ -73,6 +73,17 @@ static int json_end_map(void *ctx) {
|
|||
json_node->layout = L_SPLITH;
|
||||
}
|
||||
|
||||
/* Sanity check: swallow criteria don’t make any sense on a split
|
||||
* container. */
|
||||
if (con_is_split(json_node) > 0 && !TAILQ_EMPTY(&(json_node->swallow_head))) {
|
||||
DLOG("sanity check: removing swallows specification from split container\n");
|
||||
while (!TAILQ_EMPTY(&(json_node->swallow_head))) {
|
||||
Match *match = TAILQ_FIRST(&(json_node->swallow_head));
|
||||
TAILQ_REMOVE(&(json_node->swallow_head), match, matches);
|
||||
match_free(match);
|
||||
}
|
||||
}
|
||||
|
||||
LOG("attaching\n");
|
||||
con_attach(json_node, json_node->parent, true);
|
||||
LOG("Creating window\n");
|
||||
|
|
Loading…
Reference in New Issue