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
This commit is contained in:
Carlos Garnacho 2014-09-15 14:05:43 +02:00 committed by Matthias Clasen
parent 6b7b55f9b2
commit 0285a255bc

View File

@ -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))