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.

https://bugzilla.gnome.org/show_bug.cgi?id=629923
This commit is contained in:
Havoc Pennington 2010-12-20 13:04:45 -05:00 committed by Matthias Clasen
parent b67c5af55b
commit 9552152dd9

View File

@ -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)));
*/