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

Subscribers

People subscribed via source and target branches