From: Benjamin Otte Date: Sat, 20 Nov 2021 04:42:20 +0000 (+0100) Subject: stack: Make sure to not under-measure children X-Git-Tag: archive/raspbian/4.6.5+ds-1+rpi1~1^2~19^2~5^2~125^2~4 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=6c94835f5d690b2e0436b6cb635695b21a596d40;p=gtk4.git stack: Make sure to not under-measure children When the stack is homogeneous in only one direction, the other direction may produce min sizes to small for all children. Make sure to query at least the min size for those. --- diff --git a/gtk/gtkstack.c b/gtk/gtkstack.c index a57db53631..facf7ca3eb 100644 --- a/gtk/gtkstack.c +++ b/gtk/gtkstack.c @@ -2578,7 +2578,16 @@ gtk_stack_measure (GtkWidget *widget, if (gtk_widget_get_visible (child)) { - gtk_widget_measure (child, orientation, for_size, &child_min, &child_nat, NULL, NULL); + if (!priv->homogeneous[OPPOSITE_ORIENTATION(orientation)] && priv->visible_child != child_info) + { + int min_for_size; + + gtk_widget_measure (child, OPPOSITE_ORIENTATION (orientation), -1, &min_for_size, NULL, NULL, NULL); + + gtk_widget_measure (child, orientation, MAX (min_for_size, for_size), &child_min, &child_nat, NULL, NULL); + } + else + gtk_widget_measure (child, orientation, for_size, &child_min, &child_nat, NULL, NULL); *minimum = MAX (*minimum, child_min); *natural = MAX (*natural, child_nat);