X-Git-Url: https://git.sur5r.net/?p=i3%2Fi3;a=blobdiff_plain;f=src%2Fcon.c;h=136ce5d2a8f7a007d29a4e46f8287bdb80128dc8;hp=cec3a29b8377ac226eeaec38d846efe711815932;hb=6dd4252cd5aaf7207fb9b432962c72f8dd06d0f4;hpb=5f9a5e8d7d0eb3123fd7068452090b72b9096bea diff --git a/src/con.c b/src/con.c index cec3a29b..136ce5d2 100644 --- a/src/con.c +++ b/src/con.c @@ -1667,12 +1667,14 @@ void con_set_layout(Con *con, layout_t layout) { * whole workspace into stacked/tabbed mode. To do this and still allow * intuitive operations (like level-up and then opening a new window), we * need to create a new split container. */ - if (con->type == CT_WORKSPACE && - (layout == L_STACKED || layout == L_TABBED)) { + if (con->type == CT_WORKSPACE) { if (con_num_children(con) == 0) { - DLOG("Setting workspace_layout to %d\n", layout); - con->workspace_layout = layout; - } else { + layout_t ws_layout = (layout == L_STACKED || layout == L_TABBED) ? layout : L_DEFAULT; + DLOG("Setting workspace_layout to %d\n", ws_layout); + con->workspace_layout = ws_layout; + DLOG("Setting layout to %d\n", layout); + con->layout = layout; + } else if (layout == L_STACKED || layout == L_TABBED) { DLOG("Creating new split container\n"); /* 1: create a new split container */ Con *new = con_new(NULL, NULL);