]> git.sur5r.net Git - i3/i3/commitdiff
use splith as default when restoring a layout
authorMichael Stapelberg <michael@stapelberg.de>
Sat, 14 Dec 2013 09:41:03 +0000 (10:41 +0100)
committerMichael Stapelberg <michael@stapelberg.de>
Sun, 22 Dec 2013 20:52:49 +0000 (21:52 +0100)
This frees users from specifying layouts even when they don’t make any
difference, e.g. leaf nodes.

src/load_layout.c

index 1b08f8c17eae72821d8b69499a92f8039b8d7e88..dbd1f0df17488861bf55ee8baec6a9777b9b7e43 100644 (file)
@@ -67,6 +67,12 @@ static int json_start_map(void *ctx) {
 static int json_end_map(void *ctx) {
     LOG("end of map\n");
     if (!parsing_swallows && !parsing_rect && !parsing_window_rect && !parsing_geometry) {
+        /* Set a few default values to simplify manually crafted layout files. */
+        if (json_node->layout == L_DEFAULT) {
+            DLOG("Setting layout = L_SPLITH\n");
+            json_node->layout = L_SPLITH;
+        }
+
         LOG("attaching\n");
         con_attach(json_node, json_node->parent, true);
         LOG("Creating window\n");