[gtk+] window: Unparent popover before unmapping/unrealizing



commit d053db289ee8c480d96fa4fc9b89dacb2b160f71
Author: Carlos Garnacho <carlosg gnome org>
Date:   Mon Feb 2 16:13:30 2015 +0100

    window: Unparent popover before unmapping/unrealizing
    
    Otherwise spurious invariants warnings may happen before the popover
    is removed from the window.

 gtk/gtkwindow.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)
---
diff --git a/gtk/gtkwindow.c b/gtk/gtkwindow.c
index b761118..7f9405b 100644
--- a/gtk/gtkwindow.c
+++ b/gtk/gtkwindow.c
@@ -11695,6 +11695,11 @@ _gtk_window_remove_popover (GtkWindow *window,
   if (!data)
     return;
 
+  g_object_ref (popover);
+  gtk_widget_unparent (popover);
+
+  popover_unmap (popover, data);
+
   if (gtk_widget_get_realized (GTK_WIDGET (window)))
     popover_unrealize (popover, data, window);
 
@@ -11704,6 +11709,7 @@ _gtk_window_remove_popover (GtkWindow *window,
   _gtk_container_accessible_remove_child (GTK_CONTAINER_ACCESSIBLE (accessible),
                                           gtk_widget_get_accessible (popover), -1);
   popover_destroy (data);
+  g_object_unref (popover);
 }
 
 void


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