From: Michael Stapelberg Date: Mon, 29 Nov 2010 20:46:00 +0000 (+0100) Subject: Bugfix: Don’t attach floating clients to 'nodes' when restoring (Thanks EelVex) X-Git-Tag: tree-pr1~10 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=b0e41cb0a2d56f2fb41f6e6ab6faeb922882ee3e;p=i3%2Fi3 Bugfix: Don’t attach floating clients to 'nodes' when restoring (Thanks EelVex) --- 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; }