From: Michael Stapelberg Date: Sun, 5 Jan 2014 19:25:47 +0000 (+0100) Subject: sanity check: drop swallows for split containers (Thanks xeen) X-Git-Tag: 4.8~153 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=93cfdcd4888eb95e0f86a4e50aaec9e2daf9af9c;p=i3%2Fi3 sanity check: drop swallows for split containers (Thanks xeen) fixes #1149 --- diff --git a/src/load_layout.c b/src/load_layout.c index 7457d512..3aa96322 100644 --- a/src/load_layout.c +++ b/src/load_layout.c @@ -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");