[gtk+] stack: Store actual widget size, not preferred size



commit c7491fa1443a0e141f532982bbe6d32e82c57f5e
Author: Benjamin Otte <otte redhat com>
Date:   Thu Nov 5 04:06:09 2015 +0100

    stack: Store actual widget size, not preferred size
    
    This is just a cleanup commit, no actual bug.

 gtk/gtkstack.c |   12 +++++-------
 1 files changed, 5 insertions(+), 7 deletions(-)
---
diff --git a/gtk/gtkstack.c b/gtk/gtkstack.c
index edce6f4..b9ba150 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
         {


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]