mirror of
https://github.com/swaywm/sway.git
synced 2024-12-30 17:06:40 +01:00
[fix] handle cases where nb_master > children->length in auto layout
This commit is contained in:
parent
8b0073b195
commit
ed71e67d7e
1 changed files with 2 additions and 3 deletions
|
@ -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;
|
||||
if (container->nb_master > 0 && layout_group == 0) {
|
||||
start = 0;
|
||||
end = container->nb_master;
|
||||
end = MIN(container->nb_master, container->children->length);
|
||||
} else {
|
||||
if (group == 0) {
|
||||
start = container->nb_master;
|
||||
} else {
|
||||
start = end;
|
||||
}
|
||||
end = start +
|
||||
(nb_slaves - start + container->nb_master) / (nb_groups - layout_group);
|
||||
end = start + (nb_slaves - start + container->nb_master) / (nb_groups - layout_group);
|
||||
}
|
||||
if (group == nb_groups - 1) {
|
||||
group_dim = pos_maj + dim_maj - pos; // remaining width
|
||||
|
|
Loading…
Reference in a new issue