reduces redundant containers

Applying layout changes to the parent of the parent, in case the parent
only has a single child, stops the creation of a chain of single child
containers. The way of doing is hacky but i have no idea, what i am
doing.
This commit is contained in:
Bonsaiiv 2024-02-07 21:01:55 +01:00
parent 93d391651c
commit fc63ed440a

View file

@ -134,6 +134,9 @@ struct cmd_results *cmd_layout(int argc, char **argv) {
// Operate on parent container, like i3.
if (container) {
container = container->pending.parent;
if (container && container->pending.children->length == 1) {
container = container->pending.parent;
}
}
// We could be working with a container OR a workspace. These are different