Commit 9552152d authored by Havoc Pennington's avatar Havoc Pennington Committed by Matthias Clasen
Browse files

Always emit unmap when a widget is unmapped

Previously, for performance reasons we would sometimes
skip invoking the unmap signal (and associated vfunc)
in favor of simply unrealizing. However, widgets then
had no way to clean stuff up when they were hidden
(but still inside a parent which was shown).

This patch also removes _gtk_tooltip_hide() which
was done in both unmap and unrealize in gtkwidget.c,
now can only be in unmap.

There are probably lots of things cleaned up in
unrealize that would now be better to move to unmap.
parent b67c5af5
......@@ -4318,10 +4318,14 @@ gtk_widget_unrealize (GtkWidget *widget)
if (gtk_widget_get_realized (widget))
g_object_ref (widget);
_gtk_tooltip_hide (widget);
if (widget->priv->mapped)
gtk_widget_unmap (widget);
g_signal_emit (widget, widget_signals[UNREALIZE], 0);
g_assert (!widget->priv->mapped);
gtk_widget_set_realized (widget, FALSE);
gtk_widget_set_mapped (widget, FALSE);
g_object_unref (widget);
......@@ -10507,10 +10511,7 @@ gtk_widget_real_unrealize (GtkWidget *widget)
GtkWidgetPrivate *priv = widget->priv;
if (gtk_widget_get_mapped (widget))
gtk_widget_real_unmap (widget);
gtk_widget_set_mapped (widget, FALSE);
g_assert (!widget->priv->mapped);
/* printf ("unrealizing %s\n", g_type_name (G_TYPE_FROM_INSTANCE (widget)));
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment