Bugfix: Don’t attach floating clients to 'nodes' when restoring (Thanks EelVex)

This commit is contained in:
Michael Stapelberg 2010-11-29 21:46:00 +01:00
parent 0f0d01336b
commit b0e41cb0a2
1 changed files with 12 additions and 3 deletions

View File

@ -19,16 +19,25 @@ static bool parsing_window_rect;
struct Match *current_swallow; struct Match *current_swallow;
static int json_start_map(void *ctx) { 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) { if (parsing_swallows) {
LOG("TODO: create new swallow\n"); LOG("TODO: create new swallow\n");
current_swallow = smalloc(sizeof(Match)); current_swallow = smalloc(sizeof(Match));
match_init(current_swallow); match_init(current_swallow);
TAILQ_INSERT_TAIL(&(json_node->swallow_head), current_swallow, matches); TAILQ_INSERT_TAIL(&(json_node->swallow_head), current_swallow, matches);
} else { } else {
if (!parsing_rect && !parsing_window_rect) 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); json_node = con_new(json_node);
} }
}
}
return 1; return 1;
} }