[gtk+] window: Handle attach widget disappearing without weak pointers
- From: Benjamin Otte <otte src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] window: Handle attach widget disappearing without weak pointers
- Date: Thu, 2 May 2013 14:32:18 +0000 (UTC)
commit 43e6b3aa0303b1886ea346c6db3db319e32b2987
Author: Benjamin Otte <otte redhat com>
Date: Thu May 2 16:26:37 2013 +0200
window: Handle attach widget disappearing without weak pointers
Fixes the window not emitting a "notify::attached-to" signal when the
attach-widget goes away.
gtk/gtkwidget.c | 4 ++--
gtk/gtkwindow.c | 3 ---
2 files changed, 2 insertions(+), 5 deletions(-)
---
diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c
index 2136928..78fc44d 100644
--- a/gtk/gtkwidget.c
+++ b/gtk/gtkwidget.c
@@ -11052,8 +11052,8 @@ gtk_widget_dispose (GObject *object)
g_clear_object (&priv->muxer);
- g_list_free (priv->attached_windows);
- priv->attached_windows = NULL;
+ while (priv->attached_windows)
+ gtk_window_set_attached_to (priv->attached_windows->data, NULL);
G_OBJECT_CLASS (gtk_widget_parent_class)->dispose (object);
}
diff --git a/gtk/gtkwindow.c b/gtk/gtkwindow.c
index b6e3e15..f32f63b 100644
--- a/gtk/gtkwindow.c
+++ b/gtk/gtkwindow.c
@@ -2510,7 +2510,6 @@ remove_attach_widget (GtkWindow *window)
{
_gtk_widget_remove_attached_window (priv->attach_widget, window);
- g_object_remove_weak_pointer (priv->attach_widget, &priv->attach_widget);
priv->attach_widget = NULL;
}
}
@@ -2759,8 +2758,6 @@ gtk_window_set_attached_to (GtkWindow *window,
if (priv->attach_widget)
{
_gtk_widget_add_attached_window (priv->attach_widget, window);
-
- g_object_add_weak_pointer (priv->attach_widget, &priv->attach_widget);
}
/* Update the style, as the widget path might change. */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]