Merge lp:~dbusmenu-team/libdbusmenu/ubuntu into lp:~ubuntu-desktop/libdbusmenu/ubuntu

Proposed by Ted Gould
Status: Merged
Merged at revision: 114
Proposed branch: lp:~dbusmenu-team/libdbusmenu/ubuntu
Merge into: lp:~ubuntu-desktop/libdbusmenu/ubuntu
Diff against target: 492 lines (+180/-29)
10 files modified
ChangeLog (+52/-0)
configure (+11/-11)
configure.ac (+3/-3)
debian/changelog (+11/-0)
docs/libdbusmenu-glib/reference/version.xml (+1/-1)
docs/libdbusmenu-gtk/reference/version.xml (+1/-1)
libdbusmenu-glib/client.c (+29/-11)
libdbusmenu-glib/server.c (+2/-2)
libdbusmenu-gtk/menu.c (+39/-0)
libdbusmenu-gtk/parser.c (+31/-0)
To merge this branch: bzr merge lp:~dbusmenu-team/libdbusmenu/ubuntu
Reviewer Review Type Date Requested Status
Ken VanDine Pending
Review via email: mp+48066@code.launchpad.net

Description of the change

0.3.95

To post a comment you must log in.
lp:~dbusmenu-team/libdbusmenu/ubuntu updated
114. By Ken VanDine

releasing version 0.3.95-0ubuntu1

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'ChangeLog'
2--- ChangeLog 2011-01-27 20:19:46 +0000
3+++ ChangeLog 2011-01-31 22:08:00 +0000
4@@ -1,5 +1,57 @@
5 # Generated by Makefile. Do not edit.
6
7+2011-01-31 Ted Gould <ted@gould.cx>
8+
9+ 0.3.95
10+
11+2011-01-31 Ted Gould <ted@gould.cx>
12+
13+ Fix the property return signature.
14+
15+2011-01-31 Michael Terry <mike@mterry.name>
16+
17+ fix variant type of props return
18+
19+2011-01-31 Ted Gould <ted@gould.cx>
20+
21+ Handling changing submenus by watching for the notify event
22+
23+2011-01-31 Ted Gould <ted@gould.cx>
24+
25+ Handle the case where we don't have a cached item. Not sure how that'd be, but we shouldn't let it drop.
26+
27+2011-01-31 Ted Gould <ted@gould.cx>
28+
29+ Switching to take_children() so that we can ensure all the data remains valid
30+
31+2011-01-28 Michael Terry <mike@mterry.name>
32+
33+ notice new submenus
34+
35+2011-01-31 Ted Gould <ted@gould.cx>
36+
37+ Fixing a set of issues with not keeping references to objects in callbacks.
38+
39+2011-01-31 Ted Gould <ted@gould.cx>
40+
41+ Attaching bug number
42+
43+2011-01-31 Ted Gould <ted@gould.cx>
44+
45+ Switching the properties callback to use custom structure so that we can reference the client throughout the callback.
46+
47+2011-01-31 Ted Gould <ted@gould.cx>
48+
49+ Keeping the root so that we can remove the signal handlers.
50+
51+2011-01-31 Ted Gould <ted@gould.cx>
52+
53+ Disconnect realized handler when we don't care about the item anymore.
54+
55+2011-01-31 Ted Gould <ted@gould.cx>
56+
57+ Keep a ref to the client through-out the call to the update
58+
59 2011-01-27 Ted Gould <ted@gould.cx>
60
61 0.3.94
62
63=== modified file 'configure'
64--- configure 2011-01-27 20:20:28 +0000
65+++ configure 2011-01-31 22:08:00 +0000
66@@ -1,6 +1,6 @@
67 #! /bin/sh
68 # Guess values for system-dependent variables and create Makefiles.
69-# Generated by GNU Autoconf 2.67 for libdbusmenu 0.3.94.
70+# Generated by GNU Autoconf 2.67 for libdbusmenu 0.3.95.
71 #
72 # Report bugs to <ted@canonical.com>.
73 #
74@@ -703,8 +703,8 @@
75 # Identity of this package.
76 PACKAGE_NAME='libdbusmenu'
77 PACKAGE_TARNAME='libdbusmenu'
78-PACKAGE_VERSION='0.3.94'
79-PACKAGE_STRING='libdbusmenu 0.3.94'
80+PACKAGE_VERSION='0.3.95'
81+PACKAGE_STRING='libdbusmenu 0.3.95'
82 PACKAGE_BUGREPORT='ted@canonical.com'
83 PACKAGE_URL=''
84
85@@ -1540,7 +1540,7 @@
86 # Omit some internal or obsolete options to make the list less imposing.
87 # This message is too long to be a string in the A/UX 3.1 sh.
88 cat <<_ACEOF
89-\`configure' configures libdbusmenu 0.3.94 to adapt to many kinds of systems.
90+\`configure' configures libdbusmenu 0.3.95 to adapt to many kinds of systems.
91
92 Usage: $0 [OPTION]... [VAR=VALUE]...
93
94@@ -1610,7 +1610,7 @@
95
96 if test -n "$ac_init_help"; then
97 case $ac_init_help in
98- short | recursive ) echo "Configuration of libdbusmenu 0.3.94:";;
99+ short | recursive ) echo "Configuration of libdbusmenu 0.3.95:";;
100 esac
101 cat <<\_ACEOF
102
103@@ -1750,7 +1750,7 @@
104 test -n "$ac_init_help" && exit $ac_status
105 if $ac_init_version; then
106 cat <<\_ACEOF
107-libdbusmenu configure 0.3.94
108+libdbusmenu configure 0.3.95
109 generated by GNU Autoconf 2.67
110
111 Copyright (C) 2010 Free Software Foundation, Inc.
112@@ -2121,7 +2121,7 @@
113 This file contains any messages produced by compilers while
114 running configure, to aid debugging if configure makes a mistake.
115
116-It was created by libdbusmenu $as_me 0.3.94, which was
117+It was created by libdbusmenu $as_me 0.3.95, which was
118 generated by GNU Autoconf 2.67. Invocation command line was
119
120 $ $0 $@
121@@ -2942,7 +2942,7 @@
122
123 # Define the identity of the package.
124 PACKAGE=libdbusmenu
125- VERSION=0.3.94
126+ VERSION=0.3.95
127
128
129 # Some tools Automake needs.
130@@ -13280,7 +13280,7 @@
131 ###########################
132
133 LIBDBUSMENU_CURRENT=3
134-LIBDBUSMENU_REVISION=2
135+LIBDBUSMENU_REVISION=3
136 LIBDBUSMENU_AGE=0
137
138
139@@ -14602,7 +14602,7 @@
140 # report actual input values of CONFIG_FILES etc. instead of their
141 # values after options handling.
142 ac_log="
143-This file was extended by libdbusmenu $as_me 0.3.94, which was
144+This file was extended by libdbusmenu $as_me 0.3.95, which was
145 generated by GNU Autoconf 2.67. Invocation command line was
146
147 CONFIG_FILES = $CONFIG_FILES
148@@ -14668,7 +14668,7 @@
149 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
150 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
151 ac_cs_version="\\
152-libdbusmenu config.status 0.3.94
153+libdbusmenu config.status 0.3.95
154 configured by $0, generated by GNU Autoconf 2.67,
155 with options \\"\$ac_cs_config\\"
156
157
158=== modified file 'configure.ac'
159--- configure.ac 2011-01-27 20:20:28 +0000
160+++ configure.ac 2011-01-31 22:08:00 +0000
161@@ -1,11 +1,11 @@
162
163-AC_INIT(libdbusmenu, 0.3.94, ted@canonical.com)
164+AC_INIT(libdbusmenu, 0.3.95, ted@canonical.com)
165 AC_COPYRIGHT([Copyright 2009,2010 Canonical])
166
167 AC_PREREQ(2.62)
168
169 AM_CONFIG_HEADER(config.h)
170-AM_INIT_AUTOMAKE(libdbusmenu, 0.3.94, [-Wno-portability])
171+AM_INIT_AUTOMAKE(libdbusmenu, 0.3.95, [-Wno-portability])
172
173 AM_MAINTAINER_MODE
174
175@@ -136,7 +136,7 @@
176 ###########################
177
178 LIBDBUSMENU_CURRENT=3
179-LIBDBUSMENU_REVISION=2
180+LIBDBUSMENU_REVISION=3
181 LIBDBUSMENU_AGE=0
182
183 AC_SUBST(LIBDBUSMENU_CURRENT)
184
185=== modified file 'debian/changelog'
186--- debian/changelog 2011-01-27 21:40:56 +0000
187+++ debian/changelog 2011-01-31 22:08:00 +0000
188@@ -1,3 +1,14 @@
189+libdbusmenu (0.3.95-0ubuntu1~ppa1) natty; urgency=low
190+
191+ * New upstream release.
192+ * Fix crashes on rapidly creating and destroying client
193+ and menu objects (LP: #709754)
194+ * Fix dynamically changed submenus to get the parsed
195+ (LP: #696896)
196+ * Fix bad signature on GetProperties with no hits
197+
198+ -- Ted Gould <ted@ubuntu.com> Mon, 31 Jan 2011 16:03:06 -0600
199+
200 libdbusmenu (0.3.94-0ubuntu1) natty; urgency=low
201
202 * New upstream release.
203
204=== modified file 'docs/libdbusmenu-glib/reference/version.xml'
205--- docs/libdbusmenu-glib/reference/version.xml 2011-01-27 20:20:28 +0000
206+++ docs/libdbusmenu-glib/reference/version.xml 2011-01-31 22:08:00 +0000
207@@ -1,1 +1,1 @@
208-0.3.94
209+0.3.95
210
211=== modified file 'docs/libdbusmenu-gtk/reference/version.xml'
212--- docs/libdbusmenu-gtk/reference/version.xml 2011-01-27 20:20:28 +0000
213+++ docs/libdbusmenu-gtk/reference/version.xml 2011-01-31 22:08:00 +0000
214@@ -1,1 +1,1 @@
215-0.3.94
216+0.3.95
217
218=== modified file 'libdbusmenu-glib/client.c'
219--- libdbusmenu-glib/client.c 2011-01-27 20:13:18 +0000
220+++ libdbusmenu-glib/client.c 2011-01-31 22:08:00 +0000
221@@ -129,6 +129,12 @@
222 gchar * type;
223 };
224
225+typedef struct _properties_callback_t properties_callback_t;
226+struct _properties_callback_t {
227+ DbusmenuClient * client;
228+ GArray * listeners;
229+};
230+
231
232 #define DBUSMENU_CLIENT_GET_PRIVATE(o) (DBUSMENU_CLIENT(o)->priv)
233 #define DBUSMENU_INTERFACE "com.canonical.dbusmenu"
234@@ -512,7 +518,8 @@
235 static void
236 get_properties_callback (GObject *obj, GAsyncResult * res, gpointer user_data)
237 {
238- GArray * listeners = (GArray *)user_data;
239+ properties_callback_t * cbdata = (properties_callback_t *)user_data;
240+ GArray * listeners = cbdata->listeners;
241 int i;
242 GError * error = NULL;
243 GVariant * params = NULL;
244@@ -526,9 +533,8 @@
245 properties_listener_t * listener = &g_array_index(listeners, properties_listener_t, i);
246 listener->callback(NULL, error, listener->user_data);
247 }
248- g_array_free(listeners, TRUE);
249 g_error_free(error);
250- return;
251+ goto out;
252 }
253
254 /* Callback all the folks we can find */
255@@ -575,8 +581,11 @@
256 g_error_free(localerror);
257 }
258
259+out:
260 /* Clean up */
261 g_array_free(listeners, TRUE);
262+ g_object_unref(cbdata->client);
263+ g_free(user_data);
264
265 return;
266 }
267@@ -586,6 +595,7 @@
268 static gboolean
269 get_properties_idle (gpointer user_data)
270 {
271+ properties_callback_t * cbdata = NULL;
272 DbusmenuClientPrivate * priv = DBUSMENU_CLIENT_GET_PRIVATE(user_data);
273 g_return_val_if_fail(priv->menuproxy != NULL, TRUE);
274
275@@ -616,6 +626,11 @@
276 g_variant_builder_add_value(&builder, variant_props);
277 GVariant * variant_params = g_variant_builder_end(&builder);
278
279+ cbdata = g_new(properties_callback_t, 1);
280+ cbdata->listeners = priv->delayed_property_listeners;
281+ cbdata->client = DBUSMENU_CLIENT(user_data);
282+ g_object_ref(G_OBJECT(user_data));
283+
284 g_dbus_proxy_call(priv->menuproxy,
285 "GetGroupProperties",
286 variant_params,
287@@ -623,7 +638,7 @@
288 -1, /* timeout */
289 NULL, /* cancellable */
290 get_properties_callback,
291- priv->delayed_property_listeners);
292+ cbdata);
293
294 /* Free properties */
295 gchar ** dataregion = (gchar **)g_array_free(priv->delayed_property_list, FALSE);
296@@ -1553,11 +1568,6 @@
297 DbusmenuClient * client = DBUSMENU_CLIENT(data);
298 DbusmenuClientPrivate * priv = DBUSMENU_CLIENT_GET_PRIVATE(client);
299
300- if (priv->layoutcall != NULL) {
301- g_object_unref(priv->layoutcall);
302- priv->layoutcall = NULL;
303- }
304-
305 GError * error = NULL;
306 GVariant * params = NULL;
307
308@@ -1566,7 +1576,7 @@
309 if (error != NULL) {
310 g_warning("Getting layout failed: %s", error->message);
311 g_error_free(error);
312- return;
313+ goto out;
314 }
315
316 guint rev;
317@@ -1580,7 +1590,7 @@
318
319 if (parseable == 0) {
320 g_warning("Unable to parse layout!");
321- return;
322+ goto out;
323 }
324
325 priv->my_revision = rev;
326@@ -1596,6 +1606,13 @@
327 update_layout(client);
328 }
329
330+out:
331+ if (priv->layoutcall != NULL) {
332+ g_object_unref(priv->layoutcall);
333+ priv->layoutcall = NULL;
334+ }
335+
336+ g_object_unref(G_OBJECT(client));
337 return;
338 }
339
340@@ -1622,6 +1639,7 @@
341
342 priv->layoutcall = g_cancellable_new();
343
344+ g_object_ref(G_OBJECT(client));
345 g_dbus_proxy_call(priv->menuproxy,
346 "GetLayout",
347 g_variant_new("(i)", 0), /* root */
348
349=== modified file 'libdbusmenu-glib/server.c'
350--- libdbusmenu-glib/server.c 2011-01-26 17:13:05 +0000
351+++ libdbusmenu-glib/server.c 2011-01-31 22:08:00 +0000
352@@ -946,9 +946,9 @@
353 ret = g_variant_builder_end(&builder);
354 } else {
355 GError * error = NULL;
356- ret = g_variant_parse(g_variant_type_new("a(ia(sv))"), "[]", NULL, NULL, NULL);
357+ ret = g_variant_parse(g_variant_type_new("a(ia{sv})"), "[]", NULL, NULL, NULL);
358 if (error != NULL) {
359- g_warning("Unable to parse '[]' as a 'a(ia(sv))': %s", error->message);
360+ g_warning("Unable to parse '[]' as a 'a(ia{sv})': %s", error->message);
361 g_error_free(error);
362 ret = NULL;
363 }
364
365=== modified file 'libdbusmenu-gtk/menu.c'
366--- libdbusmenu-gtk/menu.c 2010-11-11 14:15:20 +0000
367+++ libdbusmenu-gtk/menu.c 2011-01-31 22:08:00 +0000
368@@ -46,6 +46,7 @@
369 /* Private */
370 struct _DbusmenuGtkMenuPrivate {
371 DbusmenuGtkClient * client;
372+ DbusmenuMenuitem * root;
373
374 gchar * dbus_object;
375 gchar * dbus_name;
376@@ -63,6 +64,8 @@
377 /* Internal */
378 static void build_client (DbusmenuGtkMenu * self);
379 static void child_realized (DbusmenuMenuitem * child, gpointer userdata);
380+static void remove_child_signals (gpointer data, gpointer user_data);
381+static void root_changed (DbusmenuGtkClient * client, DbusmenuMenuitem * newroot, DbusmenuGtkMenu * menu);
382
383 /* GObject Stuff */
384 G_DEFINE_TYPE (DbusmenuGtkMenu, dbusmenu_gtkmenu, GTK_TYPE_MENU);
385@@ -127,6 +130,12 @@
386 {
387 DbusmenuGtkMenuPrivate * priv = DBUSMENU_GTKMENU_GET_PRIVATE(object);
388
389+ /* Remove signals from the root */
390+ if (priv->root != NULL) {
391+ /* This will clear the root */
392+ root_changed(priv->client, NULL, DBUSMENU_GTKMENU(object));
393+ }
394+
395 if (priv->client != NULL) {
396 g_object_unref(G_OBJECT(priv->client));
397 priv->client = NULL;
398@@ -271,6 +280,10 @@
399 #ifdef MASSIVEDEBUGGING
400 g_debug("Root child deleted");
401 #endif
402+
403+ /* Remove signal for realized */
404+ remove_child_signals(child, menu);
405+
406 DbusmenuGtkMenuPrivate * priv = DBUSMENU_GTKMENU_GET_PRIVATE(menu);
407 GtkWidget * item = GTK_WIDGET(dbusmenu_gtkclient_menuitem_get(priv->client, child));
408 if (item != NULL) {
409@@ -308,15 +321,41 @@
410 return;
411 }
412
413+/* Remove any signals we attached to children -- just realized right now */
414+static void
415+remove_child_signals (gpointer data, gpointer user_data)
416+{
417+ g_signal_handlers_disconnect_by_func(G_OBJECT(data), child_realized, user_data);
418+ return;
419+}
420+
421 /* When the root menuitem changes we need to resetup things so that
422 we're back in the game. */
423 static void
424 root_changed (DbusmenuGtkClient * client, DbusmenuMenuitem * newroot, DbusmenuGtkMenu * menu) {
425+ DbusmenuGtkMenuPrivate * priv = DBUSMENU_GTKMENU_GET_PRIVATE(menu);
426+
427+ /* Clear out our interest in the old root */
428+ if (priv->root != NULL) {
429+ GList * children = dbusmenu_menuitem_get_children(priv->root);
430+ g_list_foreach(children, remove_child_signals, menu);
431+
432+ g_signal_handlers_disconnect_by_func(G_OBJECT(priv->root), root_child_added, menu);
433+ g_signal_handlers_disconnect_by_func(G_OBJECT(priv->root), root_child_moved, menu);
434+ g_signal_handlers_disconnect_by_func(G_OBJECT(priv->root), root_child_delete, menu);
435+
436+ g_object_unref(priv->root);
437+ priv->root = NULL;
438+ }
439+
440 if (newroot == NULL) {
441 gtk_widget_hide(GTK_WIDGET(menu));
442 return;
443 }
444
445+ priv->root = newroot;
446+ g_object_ref(priv->root);
447+
448 g_signal_connect(G_OBJECT(newroot), DBUSMENU_MENUITEM_SIGNAL_CHILD_ADDED, G_CALLBACK(root_child_added), menu);
449 g_signal_connect(G_OBJECT(newroot), DBUSMENU_MENUITEM_SIGNAL_CHILD_MOVED, G_CALLBACK(root_child_moved), menu);
450 g_signal_connect(G_OBJECT(newroot), DBUSMENU_MENUITEM_SIGNAL_CHILD_REMOVED, G_CALLBACK(root_child_delete), menu);
451
452=== modified file 'libdbusmenu-gtk/parser.c'
453--- libdbusmenu-gtk/parser.c 2011-01-27 20:13:18 +0000
454+++ libdbusmenu-gtk/parser.c 2011-01-31 22:08:00 +0000
455@@ -649,6 +649,37 @@
456 }
457 }
458 }
459+ else if (pspec->name == g_intern_static_string ("submenu"))
460+ {
461+ /* The underlying submenu got swapped out. Let's see what it is now. */
462+ /* First, delete any children that may exist currently. */
463+ DbusmenuMenuitem * item = DBUSMENU_MENUITEM(g_object_get_data(G_OBJECT(widget), CACHED_MENUITEM));
464+ if (item != NULL)
465+ {
466+ GList * children = dbusmenu_menuitem_take_children (item);
467+ GList * child = children;
468+ while (child != NULL) {
469+ g_object_unref (G_OBJECT(child->data));
470+ child = child->next;
471+ }
472+ g_list_free(children);
473+ }
474+
475+ /* Now parse new submenu. */
476+ RecurseContext recurse = {0};
477+ recurse.toplevel = gtk_widget_get_toplevel(widget);
478+ recurse.parent = item;
479+
480+ if (item != NULL) {
481+ GtkWidget * menu = gtk_menu_item_get_submenu (GTK_MENU_ITEM (widget));
482+ parse_menu_structure_helper(menu, &recurse);
483+ } else {
484+ /* Note: it would be really odd that we wouldn't have a cached
485+ item, but we should handle that appropriately. */
486+ parse_menu_structure_helper(widget, &recurse);
487+ g_object_unref(G_OBJECT(recurse.parent));
488+ }
489+ }
490 }
491
492 static gboolean

Subscribers

People subscribed via source and target branches

to all changes: