]> git.sur5r.net Git - i3/i3/commitdiff
Default to L_SPLITH with toggle split when last_split_layout hasn't been initialized 2849/head
authorDan Elkouby <streetwalkermc@gmail.com>
Thu, 12 Oct 2017 20:44:25 +0000 (23:44 +0300)
committerDan Elkouby <streetwalkermc@gmail.com>
Sat, 14 Oct 2017 09:27:56 +0000 (12:27 +0300)
src/con.c

index 88d1e7448ba983994da7701ae80a0b8f283e4c5a..1de91d00861c3e11736f6b2682914c70b5c83407 100644 (file)
--- a/src/con.c
+++ b/src/con.c
@@ -1848,6 +1848,10 @@ void con_toggle_layout(Con *con, const char *toggle_mode) {
                  * change to the opposite split layout. */
                 if (parent->layout != L_SPLITH && parent->layout != L_SPLITV) {
                     layout = parent->last_split_layout;
+                    /* In case last_split_layout was not initialized… */
+                    if (layout == L_DEFAULT) {
+                        layout = L_SPLITH;
+                    }
                 } else {
                     layout = (parent->layout == L_SPLITH) ? L_SPLITV : L_SPLITH;
                 }