mirror of
https://github.com/swaywm/sway.git
synced 2024-11-14 06:24:20 +01:00
[fix] handle cases where nb_master > children->length in auto layout
This commit is contained in:
parent
8b0073b195
commit
ed71e67d7e
@ -1209,15 +1209,14 @@ void apply_auto_layout(swayc_t *container, const double x, const double y,
|
|||||||
group_dim = old_group_dim[layout_group] * scale;
|
group_dim = old_group_dim[layout_group] * scale;
|
||||||
if (container->nb_master > 0 && layout_group == 0) {
|
if (container->nb_master > 0 && layout_group == 0) {
|
||||||
start = 0;
|
start = 0;
|
||||||
end = container->nb_master;
|
end = MIN(container->nb_master, container->children->length);
|
||||||
} else {
|
} else {
|
||||||
if (group == 0) {
|
if (group == 0) {
|
||||||
start = container->nb_master;
|
start = container->nb_master;
|
||||||
} else {
|
} else {
|
||||||
start = end;
|
start = end;
|
||||||
}
|
}
|
||||||
end = start +
|
end = start + (nb_slaves - start + container->nb_master) / (nb_groups - layout_group);
|
||||||
(nb_slaves - start + container->nb_master) / (nb_groups - layout_group);
|
|
||||||
}
|
}
|
||||||
if (group == nb_groups - 1) {
|
if (group == nb_groups - 1) {
|
||||||
group_dim = pos_maj + dim_maj - pos; // remaining width
|
group_dim = pos_maj + dim_maj - pos; // remaining width
|
||||||
|
Loading…
Reference in New Issue
Block a user