GtkPopover: Ensure we unset modality before unparenting the popover

Otherwise the gtk_grab_remove() calls on widget destruction will happen
on the default window group, which may leave the real window group
of the popover with a dangling pointer if it is not the default one.

This could be seen on the inspector, open a popover in the properties
list and close the window with alt-F4.
This commit is contained in:
Carlos Garnacho 2015-12-16 20:25:54 +01:00
parent 197e42efd8
commit 3be4971e05

View File

@ -188,6 +188,8 @@ static void gtk_popover_update_relative_to (GtkPopover *popover,
static void gtk_popover_set_state (GtkPopover *popover,
guint state);
static void gtk_popover_invalidate_borders (GtkPopover *popover);
static void gtk_popover_apply_modality (GtkPopover *popover,
gboolean modal);
G_DEFINE_TYPE_WITH_PRIVATE (GtkPopover, gtk_popover, GTK_TYPE_BIN)
@ -329,6 +331,9 @@ gtk_popover_dispose (GObject *object)
GtkPopover *popover = GTK_POPOVER (object);
GtkPopoverPrivate *priv = popover->priv;
if (priv->modal)
gtk_popover_apply_modality (popover, FALSE);
if (priv->window)
{
g_signal_handlers_disconnect_by_data (priv->window, popover);