[gtk+] widget: Queue resize on parent, not self



commit d65ba7cf97f332595e6c75c120d7a242d2857392
Author: Benjamin Otte <otte redhat com>
Date:   Tue Nov 3 22:51:01 2015 +0100

    widget: Queue resize on parent, not self
    
    When setting the parent of a widget, queue_resize() on the widget will
    be optimized away if the widget already had a resize queued.
    
    Plus, we do not need to resize the widget as its size request is not
    going to change.

 gtk/gtkwidget.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c
index 50bf5fc..fe28d1a 100644
--- a/gtk/gtkwidget.c
+++ b/gtk/gtkwidget.c
@@ -9649,7 +9649,7 @@ gtk_widget_set_parent (GtkWidget *widget,
          _gtk_widget_get_mapped (priv->parent))
        gtk_widget_map (widget);
 
-      gtk_widget_queue_resize (widget);
+      gtk_widget_queue_resize (priv->parent);
     }
 
   /* child may cause parent's expand to change, if the child is


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