From f19e7c9ac938990b28638ec3227e8b890e8036ce Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Sat, 11 Oct 2025 22:22:44 +0200 Subject: [PATCH] Fix pane constraint calculation for > 2 child widgets --- libs/widgets/pane.cc | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/libs/widgets/pane.cc b/libs/widgets/pane.cc index bb5ffaf727..9ba2b8f87e 100644 --- a/libs/widgets/pane.cc +++ b/libs/widgets/pane.cc @@ -434,6 +434,14 @@ Pane::constrain_fract (Dividers::size_type div, float fract) float size = horizontal ? get_allocation().get_width() : get_allocation().get_height(); size = max (0, size - (children.size() - 1) * divider_width); + /* compare to Pane::reallocate */ + Dividers::iterator d = dividers.begin(); + for (Dividers::size_type i = 0 ; i < div; ++i, ++d) { + if (children.at (i)->w->get_visible ()) { + size -= size * (*d)->fract; + } + } + // TODO: optimize: cache in Pane::on_size_request Gtk::Requisition prev_req(children.at (div)->w->size_request ()); Gtk::Requisition next_req(children.at (div + 1)->w->size_request ());