From ce480dcc74d3bec2ae9dcb4d5c77a12d35edf906 Mon Sep 17 00:00:00 2001 From: Michael Stapelberg Date: Sat, 14 Dec 2013 10:41:03 +0100 Subject: [PATCH] use splith as default when restoring a layout MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit This frees users from specifying layouts even when they don’t make any difference, e.g. leaf nodes. --- src/load_layout.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/load_layout.c b/src/load_layout.c index 1b08f8c1..dbd1f0df 100644 --- a/src/load_layout.c +++ b/src/load_layout.c @@ -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"); -- 2.39.5