[gtk+] popover: Don't run full dispose() when unmanaging the widget



commit 0285a255bc6692a2869f95776846a2c6f461fcea
Author: Carlos Garnacho <carlosg gnome org>
Date:   Mon Sep 15 14:05:43 2014 +0200

    popover: Don't run full dispose() when unmanaging the widget
    
    A popover can go unmanaged for 2 reasons, when the widget it points to
    gets destroyed, or transitionally in gtk_popover_set_relative_to(). In
    both of these cases it makes sense to only unset popover information
    about the previous widget managing it, if the popover is meant to
    survive the unmanaging through extra refs.
    
    Also, the focus widget prior to a modal popover being shown is considered
    information about the relative_to widget, unset it on
    gtk_popover_update_relative_to() with the rest.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=736193

 gtk/gtkpopover.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
---
diff --git a/gtk/gtkpopover.c b/gtk/gtkpopover.c
index bdb8c6a..65e1b05 100644
--- a/gtk/gtkpopover.c
+++ b/gtk/gtkpopover.c
@@ -1455,7 +1455,7 @@ _gtk_popover_parent_size_allocate (GtkWidget     *widget,
 static void
 _unmanage_popover (GObject *object)
 {
-  g_object_run_dispose (object);
+  gtk_popover_update_relative_to (GTK_POPOVER (object), NULL);
   g_object_unref (object);
 }
 
@@ -1577,6 +1577,8 @@ gtk_popover_update_relative_to (GtkPopover *popover,
       priv->window = NULL;
     }
 
+  g_clear_object (&priv->prev_focus_widget);
+
   if (priv->widget)
     {
       if (g_signal_handler_is_connected (priv->widget, priv->hierarchy_changed_id))


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