stack: Avoid using an uninitialized value

This was showing up as criticals since for_size != >= -1.
This commit is contained in:
Timm Bäder
2020-06-19 05:58:09 +02:00
parent d81a5a8338
commit fbb7948c13

View File

@@ -2300,9 +2300,6 @@ gtk_stack_size_allocate (GtkWidget *widget,
GtkStackPrivate *priv = gtk_stack_get_instance_private (stack);
GtkAllocation child_allocation;
child_allocation.x = get_bin_window_x (stack);
child_allocation.y = get_bin_window_y (stack);
if (priv->last_visible_child)
{
int child_width, child_height;
@@ -2313,7 +2310,7 @@ gtk_stack_size_allocate (GtkWidget *widget,
&min, &nat, NULL, NULL);
child_width = MAX (min, width);
gtk_widget_measure (priv->last_visible_child->widget, GTK_ORIENTATION_VERTICAL,
child_allocation.width,
child_width,
&min, &nat, NULL, NULL);
child_height = MAX (min, height);
@@ -2321,6 +2318,8 @@ gtk_stack_size_allocate (GtkWidget *widget,
&(GtkAllocation) { 0, 0, child_width, child_height }, -1);
}
child_allocation.x = get_bin_window_x (stack);
child_allocation.y = get_bin_window_y (stack);
child_allocation.width = width;
child_allocation.height = height;