diff --git a/sway/commands/layout.c b/sway/commands/layout.c index e0af30aa7..05ab0a18e 100644 --- a/sway/commands/layout.c +++ b/sway/commands/layout.c @@ -49,10 +49,10 @@ struct cmd_results *cmd_layout(int argc, char **argv) { } else if (strcasecmp(argv[0], "splitv") == 0) { parent->layout = L_VERT; } else if (strcasecmp(argv[0], "toggle") == 0 && argc == 2 && strcasecmp(argv[1], "split") == 0) { - if (parent->layout == L_VERT) { - parent->layout = L_HORIZ; - } else { + if (parent->layout == L_HORIZ) { parent->layout = L_VERT; + } else { + parent->layout = L_HORIZ; } } }