From: Michael Stapelberg Date: Sat, 14 Dec 2013 09:41:03 +0000 (+0100) Subject: use splith as default when restoring a layout X-Git-Tag: 4.8~201 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=ce480dcc74d3bec2ae9dcb4d5c77a12d35edf906;p=i3%2Fi3 use splith as default when restoring a layout This frees users from specifying layouts even when they don’t make any difference, e.g. leaf nodes. --- 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");