From 6125996cafeaac7130bf9ab4ac159d6625165cbc Mon Sep 17 00:00:00 2001 From: Kogasa Date: Mon, 2 May 2022 13:56:40 -0500 Subject: [PATCH] Flatten redundant splits after deleting nodes commit 0fc7afdfc875764d12549f711a49bd63a98776ce Author: Kogasa Date: Mon May 2 12:31:15 2022 -0500 aa --- sway/tree/container.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sway/tree/container.c b/sway/tree/container.c index 09766ce5c..c2d346146 100644 --- a/sway/tree/container.c +++ b/sway/tree/container.c @@ -1505,6 +1505,10 @@ void container_detach(struct sway_container *child) { if (index != -1) { list_del(siblings, index); } + // if con has one sibling which is split, deleting con leaves redundant splits. squash them + if (siblings->length == 1 && old_parent) { + container_flatten(old_parent); + } } child->pending.parent = NULL; child->pending.workspace = NULL;