From b0e41cb0a2d56f2fb41f6e6ab6faeb922882ee3e Mon Sep 17 00:00:00 2001 From: Michael Stapelberg Date: Mon, 29 Nov 2010 21:46:00 +0100 Subject: [PATCH] =?UTF-8?q?Bugfix:=20Don=E2=80=99t=20attach=20floating=20c?= =?UTF-8?q?lients=20to=20'nodes'=20when=20restoring=20(Thanks=20EelVex)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/load_layout.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/load_layout.c b/src/load_layout.c index 92270390..60a63313 100644 --- a/src/load_layout.c +++ b/src/load_layout.c @@ -19,15 +19,24 @@ static bool parsing_window_rect; struct Match *current_swallow; static int json_start_map(void *ctx) { - LOG("start of map\n"); + LOG("start of map, last_key = %s\n", last_key); if (parsing_swallows) { LOG("TODO: create new swallow\n"); current_swallow = smalloc(sizeof(Match)); match_init(current_swallow); TAILQ_INSERT_TAIL(&(json_node->swallow_head), current_swallow, matches); } else { - if (!parsing_rect && !parsing_window_rect) - json_node = con_new(json_node); + if (!parsing_rect && !parsing_window_rect) { + if (last_key && strcasecmp(last_key, "floating_nodes") == 0) { + Con *ws = con_get_workspace(json_node); + json_node = con_new(NULL); + json_node->parent = ws; + TAILQ_INSERT_TAIL(&(ws->floating_head), json_node, floating_windows); + TAILQ_INSERT_TAIL(&(ws->focus_head), json_node, focused); + } else { + json_node = con_new(json_node); + } + } } return 1; }