[gtk+] Always emit unmap when a widget is unmapped
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] Always emit unmap when a widget is unmapped
- Date: Mon, 20 Dec 2010 18:05:44 +0000 (UTC)
commit 9552152dd9c4c51fcb2847fdd15e118dd3c363f1
Author: Havoc Pennington <hp pobox com>
Date: Mon Dec 20 13:04:45 2010 -0500
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
gtk/gtkwidget.c | 13 +++++++------
1 files changed, 7 insertions(+), 6 deletions(-)
---
diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c
index 92e4278..d261b13 100644
--- a/gtk/gtkwidget.c
+++ b/gtk/gtkwidget.c
@@ -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)));
*/
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]