Merge lp:~3v1n0/libwnck/menu-dispose-events into lp:~ubuntu-desktop/libwnck/ubuntu

Proposed by Marco Trevisan (Treviño)
Status: Merged
Merged at revision: 42
Proposed branch: lp:~3v1n0/libwnck/menu-dispose-events
Merge into: lp:~ubuntu-desktop/libwnck/ubuntu
Diff against target: 133 lines (+113/-0)
3 files modified
debian/changelog (+7/-0)
debian/patches/03_window_action_menu_dispose_events.patch (+105/-0)
debian/patches/series (+1/-0)
To merge this branch: bzr merge lp:~3v1n0/libwnck/menu-dispose-events
Reviewer Review Type Date Requested Status
Ubuntu Desktop Pending
Review via email: mp+188121@code.launchpad.net

Commit message

debian/patches/03_window_action_menu_dispose_events.patch:
 - Stop idles and disconnect from signals on dispose (LP: #1191853)

Description of the change

Make sure we stop the idles that have been setup when the related window is destroyed.

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'debian/changelog'
2--- debian/changelog 2011-09-08 15:12:02 +0000
3+++ debian/changelog 2013-09-27 18:07:49 +0000
4@@ -1,3 +1,10 @@
5+libwnck (1:2.30.7-0ubuntu2) UNRELEASED; urgency=low
6+
7+ * debian/patches/03_window_action_menu_dispose_events.patch:
8+ - Stop idles and disconnect from signals on dispose (LP: #1191853)
9+
10+ -- Marco Trevisan <marco@ubuntu.com> Fri, 27 Sep 2013 19:52:16 +0200
11+
12 libwnck (1:2.30.7-0ubuntu1) oneiric; urgency=low
13
14 * New upstream release
15
16=== added file 'debian/patches/03_window_action_menu_dispose_events.patch'
17--- debian/patches/03_window_action_menu_dispose_events.patch 1970-01-01 00:00:00 +0000
18+++ debian/patches/03_window_action_menu_dispose_events.patch 2013-09-27 18:07:49 +0000
19@@ -0,0 +1,105 @@
20+Description: WindowActionMenu: unset window and stop async events on dispose
21+ Finalize function can be never called on menu, so it's better to do this when
22+ the widget gets destroyed.
23+
24+Origin: upstream, https://git.gnome.org/browse/libwnck/commit/?h=gtk2&id=9e17ab5b
25+Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/libwnck/+bug/1191853
26+Forwarded: yes
27+Author: Marco Trevisan <marco@ubuntu.com>
28+
29+diff --git a/libwnck/window-action-menu.c b/libwnck/window-action-menu.c
30+index e687cff..1e4b27e 100644
31+--- a/libwnck/window-action-menu.c
32++++ b/libwnck/window-action-menu.c
33+@@ -104,10 +104,8 @@ enum {
34+ G_DEFINE_TYPE (WnckActionMenu, wnck_action_menu, GTK_TYPE_MENU);
35+ #define WNCK_ACTION_MENU_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), WNCK_TYPE_ACTION_MENU, WnckActionMenuPrivate))
36+
37+-static void wnck_action_menu_finalize (GObject *object);
38++static void wnck_action_menu_dispose (GObject *object);
39+
40+-static void object_weak_notify (gpointer data,
41+- GObject *obj);
42+ static void window_weak_notify (gpointer data,
43+ GObject *window);
44+
45+@@ -118,23 +116,10 @@ static void
46+ window_weak_notify (gpointer data,
47+ GObject *window)
48+ {
49+- g_object_weak_unref (G_OBJECT (data),
50+- object_weak_notify,
51+- window);
52+-
53++ WNCK_ACTION_MENU(data)->priv->window = NULL;
54+ gtk_widget_destroy (GTK_WIDGET (data));
55+ }
56+
57+-
58+-static void
59+-object_weak_notify (gpointer data,
60+- GObject *obj)
61+-{
62+- g_object_weak_unref (G_OBJECT (data),
63+- window_weak_notify,
64+- obj);
65+-}
66+-
67+ static WnckActionMenu*
68+ get_action_menu (GtkWidget *widget)
69+ {
70+@@ -1030,7 +1015,6 @@ wnck_action_menu_constructor (GType type,
71+ }
72+
73+ g_object_weak_ref (G_OBJECT (priv->window), window_weak_notify, menu);
74+- g_object_weak_ref (G_OBJECT (menu), object_weak_notify, priv->window);
75+
76+ priv->minimize_item = make_menu_item (MINIMIZE);
77+
78+@@ -1181,7 +1165,7 @@ wnck_action_menu_class_init (WnckActionMenuClass *klass)
79+ object_class->constructor = wnck_action_menu_constructor;
80+ object_class->get_property = wnck_action_menu_get_property;
81+ object_class->set_property = wnck_action_menu_set_property;
82+- object_class->finalize = wnck_action_menu_finalize;
83++ object_class->dispose = wnck_action_menu_dispose;
84+
85+ g_object_class_install_property (object_class,
86+ PROP_WINDOW,
87+@@ -1192,17 +1176,30 @@ wnck_action_menu_class_init (WnckActionMenuClass *klass)
88+ }
89+
90+ static void
91+-wnck_action_menu_finalize (GObject *object)
92++wnck_action_menu_dispose (GObject *object)
93+ {
94+ WnckActionMenu *menu;
95+
96+ menu = WNCK_ACTION_MENU (object);
97+
98+ if (menu->priv->idle_handler)
99+- g_source_remove (menu->priv->idle_handler);
100+- menu->priv->idle_handler = 0;
101++ {
102++ g_source_remove (menu->priv->idle_handler);
103++ menu->priv->idle_handler = 0;
104++ }
105++
106++ if (WNCK_IS_WINDOW (menu->priv->window))
107++ {
108++ g_object_weak_unref (G_OBJECT (menu->priv->window), window_weak_notify, menu);
109++ g_signal_handlers_disconnect_by_data (menu->priv->window, menu);
110++
111++ WnckScreen *screen = wnck_window_get_screen (menu->priv->window);
112++ g_signal_handlers_disconnect_by_data (screen, menu);
113++
114++ menu->priv->window = NULL;
115++ }
116+
117+- G_OBJECT_CLASS (wnck_action_menu_parent_class)->finalize (object);
118++ G_OBJECT_CLASS (wnck_action_menu_parent_class)->dispose (object);
119+ }
120+
121+ /**
122+--
123+1.8.3.2
124+
125
126=== modified file 'debian/patches/series'
127--- debian/patches/series 2011-01-04 06:20:37 +0000
128+++ debian/patches/series 2013-09-27 18:07:49 +0000
129@@ -1,3 +1,4 @@
130 01_tasklist_orientation.patch
131 02_moveresize_static_gravity.patch
132+03_window_action_menu_dispose_events.patch
133 99_ltmain_as-needed.patch

Subscribers

People subscribed via source and target branches