]> git.sur5r.net Git - i3/i3/commitdiff
Bugfix: Don’t attach floating clients to 'nodes' when restoring (Thanks EelVex)
authorMichael Stapelberg <michael@stapelberg.de>
Mon, 29 Nov 2010 20:46:00 +0000 (21:46 +0100)
committerMichael Stapelberg <michael@stapelberg.de>
Mon, 29 Nov 2010 20:46:00 +0000 (21:46 +0100)
src/load_layout.c

index 922703907e387a86132591f80e7f2190eec301e9..60a6331389f654490119c9339b90b46cb3dc11bb 100644 (file)
@@ -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;
 }