mirror of
https://github.com/swaywm/sway.git
synced 2025-01-31 13:16:42 +00:00
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:
parent
93d391651c
commit
fc63ed440a
|
@ -134,6 +134,9 @@ struct cmd_results *cmd_layout(int argc, char **argv) {
|
||||||
// Operate on parent container, like i3.
|
// Operate on parent container, like i3.
|
||||||
if (container) {
|
if (container) {
|
||||||
container = container->pending.parent;
|
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
|
// We could be working with a container OR a workspace. These are different
|
||||||
|
|
Loading…
Reference in a new issue