From c7491fa1443a0e141f532982bbe6d32e82c57f5e Mon Sep 17 00:00:00 2001 From: Benjamin Otte Date: Thu, 5 Nov 2015 04:06:09 +0100 Subject: [PATCH] stack: Store actual widget size, not preferred size This is just a cleanup commit, no actual bug. --- gtk/gtkstack.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/gtk/gtkstack.c b/gtk/gtkstack.c index edce6f4d07..b9ba150c23 100644 --- a/gtk/gtkstack.c +++ b/gtk/gtkstack.c @@ -1093,14 +1093,12 @@ set_visible_child (GtkStack *stack, { if (gtk_widget_is_visible (widget)) { - int fake; + GtkAllocation allocation; + priv->last_visible_child = priv->visible_child; - gtk_widget_get_preferred_width (priv->last_visible_child->widget, - &fake, - &priv->last_visible_widget_width); - gtk_widget_get_preferred_height (priv->last_visible_child->widget, - &fake, - &priv->last_visible_widget_height); + gtk_widget_get_allocated_size (priv->last_visible_child->widget, &allocation, NULL); + priv->last_visible_widget_width = allocation.width; + priv->last_visible_widget_height = allocation.height; } else {