[gtk+] widget: Don't notify :parent when rearranging widgets



commit 09239eb670208d88bc17997a8bb7319be18b286f
Author: Timm Bäder <mail baedert org>
Date:   Sun Oct 29 17:27:53 2017 +0100

    widget: Don't notify :parent when rearranging widgets
    
    gtk_widget_reposition_after is also valid to call if the widget already
    has a parent, so don't notify the parent property in that case.

 gtk/gtkwidget.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
---
diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c
index ebf5dbf..d603906 100644
--- a/gtk/gtkwidget.c
+++ b/gtk/gtkwidget.c
@@ -8360,7 +8360,9 @@ gtk_widget_reposition_after (GtkWidget *widget,
 
   if (priv->parent->priv->anchored && prev_parent == NULL)
     _gtk_widget_propagate_hierarchy_changed (widget, NULL);
-  g_object_notify_by_pspec (G_OBJECT (widget), widget_props[PROP_PARENT]);
+
+  if (prev_parent == NULL)
+    g_object_notify_by_pspec (G_OBJECT (widget), widget_props[PROP_PARENT]);
 
   /* Enforce realized/mapped invariants
    */


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