From a06052ad9da8f5e03b17aa791be49189f21b7a4f Mon Sep 17 00:00:00 2001 From: Drew DeVault Date: Thu, 5 Apr 2018 23:22:33 -0400 Subject: [PATCH] Fix splitting workspaces --- sway/tree/layout.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/sway/tree/layout.c b/sway/tree/layout.c index e91fd5acb..0011a9e3b 100644 --- a/sway/tree/layout.c +++ b/sway/tree/layout.c @@ -951,6 +951,14 @@ struct sway_container *container_split(struct sway_container *child, if (!sway_assert(child, "child cannot be null")) { return NULL; } + if (child->type == C_WORKSPACE && child->children->length == 0) { + // Special case: this just behaves like splitt + child->prev_layout = child->layout; + child->layout = layout; + arrange_windows(child, -1, -1); + return child; + } + struct sway_container *cont = container_create(C_CONTAINER); wlr_log(L_DEBUG, "creating container %p around %p", cont, child);