Flatten redundant splits after deleting nodes

commit 0fc7afdfc875764d12549f711a49bd63a98776ce
Author: Kogasa <kogasapls@gmail.com>
Date:   Mon May 2 12:31:15 2022 -0500

    aa
This commit is contained in:
Kogasa 2022-05-02 13:56:40 -05:00
parent a7898637de
commit 6125996caf

View file

@ -1505,6 +1505,10 @@ void container_detach(struct sway_container *child) {
if (index != -1) { if (index != -1) {
list_del(siblings, index); 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.parent = NULL;
child->pending.workspace = NULL; child->pending.workspace = NULL;