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

Proposed by Ted Gould
Status: Merged
Merged at revision: 137
Proposed branch: lp:~dbusmenu-team/libdbusmenu/ubuntu
Merge into: lp:~ubuntu-desktop/libdbusmenu/ubuntu
Diff against target: 572 lines (+229/-47)
13 files modified
ChangeLog (+78/-0)
configure (+11/-11)
configure.ac (+3/-3)
debian/changelog (+9/-0)
docs/libdbusmenu-glib/reference/html/ch01.html (+1/-1)
docs/libdbusmenu-glib/reference/version.xml (+1/-1)
docs/libdbusmenu-gtk/reference/html/ch01.html (+1/-1)
docs/libdbusmenu-gtk/reference/version.xml (+1/-1)
libdbusmenu-glib/client.c (+23/-5)
libdbusmenu-glib/defaults.c (+2/-2)
libdbusmenu-gtk/menuitem.c (+16/-5)
libdbusmenu-gtk/parser.c (+81/-15)
ltmain.sh (+2/-2)
To merge this branch: bzr merge lp:~dbusmenu-team/libdbusmenu/ubuntu
Reviewer Review Type Date Requested Status
Ken VanDine Pending
Review via email: mp+55811@code.launchpad.net

Description of the change

Release 0.4.1

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

releasing version 0.4.1-0ubuntu1

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'ChangeLog'
--- ChangeLog 2011-03-23 19:46:23 +0000
+++ ChangeLog 2011-03-31 18:59:23 +0000
@@ -1,5 +1,83 @@
1# Generated by Makefile. Do not edit.1# Generated by Makefile. Do not edit.
22
32011-03-31 Ted Gould <ted@gould.cx>
4
5 0.4.1
6
72011-03-31 Ted Gould <ted@gould.cx>
8
9 Ensuring that our iterators have variants to reference and ref'ing them correctly.
10
112011-03-29 Ted Gould <ted@gould.cx>
12
13 Be more specific about the shortcut type
14
152011-03-29 Ted Gould <ted@gould.cx>
16
17 Split out into another variable
18
192011-03-28 Ted Gould <ted@gould.cx>
20
21 Use loop instead of next
22
232011-03-28 Ted Gould <ted@gould.cx>
24
25 Putting in some protections from NULL parameters.
26
272011-03-28 Ted Gould <ted@gould.cx>
28
29 Don't unref a variant we didn't have a ref to on error
30
312011-03-31 Ted Gould <ted@gould.cx>
32
33 Turning GTK Menuitems without labels into separators.
34
352011-03-30 Chris Coulson <chrisccoulson@ubuntu.com>
36
37 Remove some code duplication introduced in this branch
38
392011-03-30 Chris Coulson <chrisccoulson@ubuntu.com>
40
41 - Don't change the type of existing menu items in the server. This
42 isn't handled in the client too well
43 - Handle a GtkMenuItem's GtkLabel being removed too
44
452011-03-30 Chris Coulson <chrisccoulson@ubuntu.com>
46
47 Remove the now unneeded null pointer check on label in construct_dbusmenu_for_widget.
48 Also, don't use a strcmp in widget_notify_cb for checking if the menuitem is a separator. Just do a null pointer
49 check on pdata->label instead
50
512011-03-30 Chris Coulson <chrisccoulson@ubuntu.com>
52
53 Revert the last commit and handle the same problem in the parser instead
54
552011-03-29 Chris Coulson <chrisccoulson@ubuntu.com>
56
57 Don't set a default label for menuitems. Some applications (eg, xchat and pidgin) do silly things like
58 creating GtkMenuItems's without a label for separators (rather than using the GtkSeparatorMenuItem class).
59 GTK correctly renders these as separators, so we need to handle it too by not setting a default label on these
60
612011-03-28 Ted Gould <ted@gould.cx>
62
63 Ensure the parent stays ref'd
64
652011-03-25 Michael Terry <mike@mterry.name>
66
67 fix some potential memory issues in hopes of fixing a reported crash
68
692011-03-28 Ted Gould <ted@gould.cx>
70
71 Protect our properties parsing a bit more.
72
732011-03-24 Ted Gould <ted@gould.cx>
74
75 Attaching bug
76
772011-03-24 Ted Gould <ted@gould.cx>
78
79 Put in some more protections on the types for property variants and generate some errors
80
32011-03-23 Ted Gould <ted@gould.cx>812011-03-23 Ted Gould <ted@gould.cx>
482
5 0.4.083 0.4.0
684
=== modified file 'configure'
--- configure 2011-03-23 19:48:54 +0000
+++ configure 2011-03-31 18:59:23 +0000
@@ -1,6 +1,6 @@
1#! /bin/sh1#! /bin/sh
2# Guess values for system-dependent variables and create Makefiles.2# Guess values for system-dependent variables and create Makefiles.
3# Generated by GNU Autoconf 2.67 for libdbusmenu 0.4.0.3# Generated by GNU Autoconf 2.67 for libdbusmenu 0.4.1.
4#4#
5# Report bugs to <ted@canonical.com>.5# Report bugs to <ted@canonical.com>.
6#6#
@@ -703,8 +703,8 @@
703# Identity of this package.703# Identity of this package.
704PACKAGE_NAME='libdbusmenu'704PACKAGE_NAME='libdbusmenu'
705PACKAGE_TARNAME='libdbusmenu'705PACKAGE_TARNAME='libdbusmenu'
706PACKAGE_VERSION='0.4.0'706PACKAGE_VERSION='0.4.1'
707PACKAGE_STRING='libdbusmenu 0.4.0'707PACKAGE_STRING='libdbusmenu 0.4.1'
708PACKAGE_BUGREPORT='ted@canonical.com'708PACKAGE_BUGREPORT='ted@canonical.com'
709PACKAGE_URL=''709PACKAGE_URL=''
710710
@@ -1541,7 +1541,7 @@
1541 # Omit some internal or obsolete options to make the list less imposing.1541 # Omit some internal or obsolete options to make the list less imposing.
1542 # This message is too long to be a string in the A/UX 3.1 sh.1542 # This message is too long to be a string in the A/UX 3.1 sh.
1543 cat <<_ACEOF1543 cat <<_ACEOF
1544\`configure' configures libdbusmenu 0.4.0 to adapt to many kinds of systems.1544\`configure' configures libdbusmenu 0.4.1 to adapt to many kinds of systems.
15451545
1546Usage: $0 [OPTION]... [VAR=VALUE]...1546Usage: $0 [OPTION]... [VAR=VALUE]...
15471547
@@ -1611,7 +1611,7 @@
16111611
1612if test -n "$ac_init_help"; then1612if test -n "$ac_init_help"; then
1613 case $ac_init_help in1613 case $ac_init_help in
1614 short | recursive ) echo "Configuration of libdbusmenu 0.4.0:";;1614 short | recursive ) echo "Configuration of libdbusmenu 0.4.1:";;
1615 esac1615 esac
1616 cat <<\_ACEOF1616 cat <<\_ACEOF
16171617
@@ -1751,7 +1751,7 @@
1751test -n "$ac_init_help" && exit $ac_status1751test -n "$ac_init_help" && exit $ac_status
1752if $ac_init_version; then1752if $ac_init_version; then
1753 cat <<\_ACEOF1753 cat <<\_ACEOF
1754libdbusmenu configure 0.4.01754libdbusmenu configure 0.4.1
1755generated by GNU Autoconf 2.671755generated by GNU Autoconf 2.67
17561756
1757Copyright (C) 2010 Free Software Foundation, Inc.1757Copyright (C) 2010 Free Software Foundation, Inc.
@@ -2122,7 +2122,7 @@
2122This file contains any messages produced by compilers while2122This file contains any messages produced by compilers while
2123running configure, to aid debugging if configure makes a mistake.2123running configure, to aid debugging if configure makes a mistake.
21242124
2125It was created by libdbusmenu $as_me 0.4.0, which was2125It was created by libdbusmenu $as_me 0.4.1, which was
2126generated by GNU Autoconf 2.67. Invocation command line was2126generated by GNU Autoconf 2.67. Invocation command line was
21272127
2128 $ $0 $@2128 $ $0 $@
@@ -2943,7 +2943,7 @@
29432943
2944# Define the identity of the package.2944# Define the identity of the package.
2945 PACKAGE=libdbusmenu2945 PACKAGE=libdbusmenu
2946 VERSION=0.4.02946 VERSION=0.4.1
29472947
29482948
2949# Some tools Automake needs.2949# Some tools Automake needs.
@@ -13294,7 +13294,7 @@
13294###########################13294###########################
1329513295
13296LIBDBUSMENU_CURRENT=313296LIBDBUSMENU_CURRENT=3
13297LIBDBUSMENU_REVISION=1113297LIBDBUSMENU_REVISION=12
13298LIBDBUSMENU_AGE=013298LIBDBUSMENU_AGE=0
1329913299
1330013300
@@ -14616,7 +14616,7 @@
14616# report actual input values of CONFIG_FILES etc. instead of their14616# report actual input values of CONFIG_FILES etc. instead of their
14617# values after options handling.14617# values after options handling.
14618ac_log="14618ac_log="
14619This file was extended by libdbusmenu $as_me 0.4.0, which was14619This file was extended by libdbusmenu $as_me 0.4.1, which was
14620generated by GNU Autoconf 2.67. Invocation command line was14620generated by GNU Autoconf 2.67. Invocation command line was
1462114621
14622 CONFIG_FILES = $CONFIG_FILES14622 CONFIG_FILES = $CONFIG_FILES
@@ -14682,7 +14682,7 @@
14682cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=114682cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
14683ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"14683ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
14684ac_cs_version="\\14684ac_cs_version="\\
14685libdbusmenu config.status 0.4.014685libdbusmenu config.status 0.4.1
14686configured by $0, generated by GNU Autoconf 2.67,14686configured by $0, generated by GNU Autoconf 2.67,
14687 with options \\"\$ac_cs_config\\"14687 with options \\"\$ac_cs_config\\"
1468814688
1468914689
=== modified file 'configure.ac'
--- configure.ac 2011-03-23 19:48:54 +0000
+++ configure.ac 2011-03-31 18:59:23 +0000
@@ -1,11 +1,11 @@
11
2AC_INIT(libdbusmenu, 0.4.0, ted@canonical.com)2AC_INIT(libdbusmenu, 0.4.1, ted@canonical.com)
3AC_COPYRIGHT([Copyright 2009,2010 Canonical])3AC_COPYRIGHT([Copyright 2009,2010 Canonical])
44
5AC_PREREQ(2.62)5AC_PREREQ(2.62)
66
7AM_CONFIG_HEADER(config.h)7AM_CONFIG_HEADER(config.h)
8AM_INIT_AUTOMAKE(libdbusmenu, 0.4.0, [-Wno-portability])8AM_INIT_AUTOMAKE(libdbusmenu, 0.4.1, [-Wno-portability])
99
10AM_MAINTAINER_MODE10AM_MAINTAINER_MODE
1111
@@ -134,7 +134,7 @@
134###########################134###########################
135135
136LIBDBUSMENU_CURRENT=3136LIBDBUSMENU_CURRENT=3
137LIBDBUSMENU_REVISION=11137LIBDBUSMENU_REVISION=12
138LIBDBUSMENU_AGE=0138LIBDBUSMENU_AGE=0
139139
140AC_SUBST(LIBDBUSMENU_CURRENT)140AC_SUBST(LIBDBUSMENU_CURRENT)
141141
=== modified file 'debian/changelog'
--- debian/changelog 2011-03-28 19:15:29 +0000
+++ debian/changelog 2011-03-31 18:59:23 +0000
@@ -1,3 +1,12 @@
1libdbusmenu (0.4.1-0ubuntu1~ppa1) natty; urgency=low
2
3 * New upstream release.
4 * Managed variant iterators better to stop crash when dealing
5 with apps that have multiple shortcuts (LP: #741726)
6 * Handled GtkMenuItems with no labels as separators (LP: #729187)
7
8 -- Ted Gould <ted@ubuntu.com> Thu, 31 Mar 2011 13:56:54 -0500
9
1libdbusmenu (0.4.0-0ubuntu2) natty; urgency=low10libdbusmenu (0.4.0-0ubuntu2) natty; urgency=low
211
3 * Cherry picked fix for potential memory issues to fix unity-panel-service12 * Cherry picked fix for potential memory issues to fix unity-panel-service
413
=== modified file 'docs/libdbusmenu-glib/reference/html/ch01.html'
--- docs/libdbusmenu-glib/reference/html/ch01.html 2011-03-23 19:46:23 +0000
+++ docs/libdbusmenu-glib/reference/html/ch01.html 2011-03-31 18:59:23 +0000
@@ -21,7 +21,7 @@
21</tr></table>21</tr></table>
22<div class="chapter">22<div class="chapter">
23<div class="titlepage"><div><div><h2 class="title">23<div class="titlepage"><div><div><h2 class="title">
24<a name="id440860"></a>API</h2></div></div></div>24<a name="id471000"></a>API</h2></div></div></div>
25<div class="toc"><dl>25<div class="toc"><dl>
26<dt>26<dt>
27<span class="refentrytitle"><a href="libdbusmenu-glib-DbusmenuServer.html">DbusmenuServer</a></span><span class="refpurpose"> — The server signals changed and27<span class="refentrytitle"><a href="libdbusmenu-glib-DbusmenuServer.html">DbusmenuServer</a></span><span class="refpurpose"> — The server signals changed and
2828
=== modified file 'docs/libdbusmenu-glib/reference/version.xml'
--- docs/libdbusmenu-glib/reference/version.xml 2011-03-23 19:48:54 +0000
+++ docs/libdbusmenu-glib/reference/version.xml 2011-03-31 18:59:23 +0000
@@ -1,1 +1,1 @@
10.4.010.4.1
22
=== modified file 'docs/libdbusmenu-gtk/reference/html/ch01.html'
--- docs/libdbusmenu-gtk/reference/html/ch01.html 2011-03-23 19:46:23 +0000
+++ docs/libdbusmenu-gtk/reference/html/ch01.html 2011-03-31 18:59:23 +0000
@@ -21,7 +21,7 @@
21</tr></table>21</tr></table>
22<div class="chapter">22<div class="chapter">
23<div class="titlepage"><div><div><h2 class="title">23<div class="titlepage"><div><div><h2 class="title">
24<a name="id331770"></a>API</h2></div></div></div>24<a name="id520868"></a>API</h2></div></div></div>
25<div class="toc"><dl>25<div class="toc"><dl>
26<dt>26<dt>
27<span class="refentrytitle"><a href="libdbusmenu-gtk-DbusmenuGtkMenu.html">DbusmenuGtkMenu</a></span><span class="refpurpose"> — A GTK Menu Object that syncronizes over DBus</span>27<span class="refentrytitle"><a href="libdbusmenu-gtk-DbusmenuGtkMenu.html">DbusmenuGtkMenu</a></span><span class="refpurpose"> — A GTK Menu Object that syncronizes over DBus</span>
2828
=== modified file 'docs/libdbusmenu-gtk/reference/version.xml'
--- docs/libdbusmenu-gtk/reference/version.xml 2011-03-23 19:48:54 +0000
+++ docs/libdbusmenu-gtk/reference/version.xml 2011-03-31 18:59:23 +0000
@@ -1,1 +1,1 @@
10.4.010.4.1
22
=== modified file 'libdbusmenu-glib/client.c'
--- libdbusmenu-glib/client.c 2011-03-28 19:15:29 +0000
+++ libdbusmenu-glib/client.c 2011-03-31 18:59:23 +0000
@@ -1334,8 +1334,16 @@
13341334
1335 if (error != NULL) {1335 if (error != NULL) {
1336 g_warning("Error getting properties on a menuitem: %s", error->message);1336 g_warning("Error getting properties on a menuitem: %s", error->message);
1337 g_object_unref(data);1337 goto out;
1338 return;1338 }
1339
1340 if (properties == NULL) {
1341 goto out;
1342 }
1343
1344 if (!g_variant_is_of_type(properties, G_VARIANT_TYPE("a{sv}"))) {
1345 g_warning("Properties are of type '%s' instead of type '%s'", g_variant_get_type_string(properties), "a{sv}");
1346 goto out;
1339 }1347 }
13401348
1341 GVariantIter iter;1349 GVariantIter iter;
@@ -1348,6 +1356,7 @@
1348 dbusmenu_menuitem_property_set_variant(item, key, value);1356 dbusmenu_menuitem_property_set_variant(item, key, value);
1349 }1357 }
13501358
1359out:
1351 g_object_unref(data);1360 g_object_unref(data);
13521361
1353 return;1362 return;
@@ -1366,12 +1375,16 @@
1366 g_warning("Unable to replace properties on %d: %s", dbusmenu_menuitem_get_id(DBUSMENU_MENUITEM(data)), error->message);1375 g_warning("Unable to replace properties on %d: %s", dbusmenu_menuitem_get_id(DBUSMENU_MENUITEM(data)), error->message);
1367 have_error = TRUE;1376 have_error = TRUE;
1368 }1377 }
1378
1379 if (properties == NULL) {
1380 have_error = TRUE;
1381 }
13691382
1370 /* Get the list of the current properties */1383 /* Get the list of the current properties */
1371 GList * current_props = dbusmenu_menuitem_properties_list(DBUSMENU_MENUITEM(data));1384 GList * current_props = dbusmenu_menuitem_properties_list(DBUSMENU_MENUITEM(data));
1372 GList * tmp = NULL;1385 GList * tmp = NULL;
13731386
1374 if (properties != NULL && have_error == FALSE) {1387 if (!have_error && g_variant_is_of_type(properties, G_VARIANT_TYPE("a{sv}"))) {
1375 GVariantIter iter;1388 GVariantIter iter;
1376 g_variant_iter_init(&iter, properties);1389 g_variant_iter_init(&iter, properties);
1377 gchar * name; GVariant * value;1390 gchar * name; GVariant * value;
@@ -1415,8 +1428,12 @@
14151428
1416 if (error != NULL) {1429 if (error != NULL) {
1417 g_warning("Error getting properties on a new menuitem: %s", error->message);1430 g_warning("Error getting properties on a new menuitem: %s", error->message);
1418 g_object_unref(propdata->item);1431 goto out;
1419 return;1432 }
1433
1434 if (properties == NULL) {
1435 g_warning("Not realizing new item as properties for it were unavailable");
1436 goto out;
1420 }1437 }
14211438
1422 DbusmenuClientPrivate * priv = DBUSMENU_CLIENT_GET_PRIVATE(propdata->client);1439 DbusmenuClientPrivate * priv = DBUSMENU_CLIENT_GET_PRIVATE(propdata->client);
@@ -1450,6 +1467,7 @@
1450 g_signal_emit(G_OBJECT(propdata->client), signals[NEW_MENUITEM], 0, propdata->item, TRUE);1467 g_signal_emit(G_OBJECT(propdata->client), signals[NEW_MENUITEM], 0, propdata->item, TRUE);
1451 }1468 }
14521469
1470out:
1453 g_object_unref(propdata->item);1471 g_object_unref(propdata->item);
1454 g_free(propdata);1472 g_free(propdata);
14551473
14561474
=== modified file 'libdbusmenu-glib/defaults.c'
--- libdbusmenu-glib/defaults.c 2011-02-25 14:47:56 +0000
+++ libdbusmenu-glib/defaults.c 2011-03-31 18:59:23 +0000
@@ -81,11 +81,11 @@
81 /* Standard defaults */81 /* Standard defaults */
82 dbusmenu_defaults_default_set(self, DBUSMENU_CLIENT_TYPES_DEFAULT, DBUSMENU_MENUITEM_PROP_VISIBLE, G_VARIANT_TYPE_BOOLEAN, g_variant_new_boolean(TRUE)); 82 dbusmenu_defaults_default_set(self, DBUSMENU_CLIENT_TYPES_DEFAULT, DBUSMENU_MENUITEM_PROP_VISIBLE, G_VARIANT_TYPE_BOOLEAN, g_variant_new_boolean(TRUE));
83 dbusmenu_defaults_default_set(self, DBUSMENU_CLIENT_TYPES_DEFAULT, DBUSMENU_MENUITEM_PROP_ENABLED, G_VARIANT_TYPE_BOOLEAN, g_variant_new_boolean(TRUE)); 83 dbusmenu_defaults_default_set(self, DBUSMENU_CLIENT_TYPES_DEFAULT, DBUSMENU_MENUITEM_PROP_ENABLED, G_VARIANT_TYPE_BOOLEAN, g_variant_new_boolean(TRUE));
84 dbusmenu_defaults_default_set(self, DBUSMENU_CLIENT_TYPES_DEFAULT, DBUSMENU_MENUITEM_PROP_LABEL, G_VARIANT_TYPE_STRING, g_variant_new_string(_("Label Empty"))); 84 dbusmenu_defaults_default_set(self, DBUSMENU_CLIENT_TYPES_DEFAULT, DBUSMENU_MENUITEM_PROP_LABEL, G_VARIANT_TYPE_STRING, g_variant_new_string(_("Label Empty")));
85 dbusmenu_defaults_default_set(self, DBUSMENU_CLIENT_TYPES_DEFAULT, DBUSMENU_MENUITEM_PROP_ICON_NAME, G_VARIANT_TYPE_STRING, NULL); 85 dbusmenu_defaults_default_set(self, DBUSMENU_CLIENT_TYPES_DEFAULT, DBUSMENU_MENUITEM_PROP_ICON_NAME, G_VARIANT_TYPE_STRING, NULL);
86 dbusmenu_defaults_default_set(self, DBUSMENU_CLIENT_TYPES_DEFAULT, DBUSMENU_MENUITEM_PROP_TOGGLE_TYPE, G_VARIANT_TYPE_STRING, NULL); 86 dbusmenu_defaults_default_set(self, DBUSMENU_CLIENT_TYPES_DEFAULT, DBUSMENU_MENUITEM_PROP_TOGGLE_TYPE, G_VARIANT_TYPE_STRING, NULL);
87 dbusmenu_defaults_default_set(self, DBUSMENU_CLIENT_TYPES_DEFAULT, DBUSMENU_MENUITEM_PROP_TOGGLE_STATE, G_VARIANT_TYPE_INT32, NULL); 87 dbusmenu_defaults_default_set(self, DBUSMENU_CLIENT_TYPES_DEFAULT, DBUSMENU_MENUITEM_PROP_TOGGLE_STATE, G_VARIANT_TYPE_INT32, NULL);
88 dbusmenu_defaults_default_set(self, DBUSMENU_CLIENT_TYPES_DEFAULT, DBUSMENU_MENUITEM_PROP_SHORTCUT, G_VARIANT_TYPE_ARRAY, NULL); 88 dbusmenu_defaults_default_set(self, DBUSMENU_CLIENT_TYPES_DEFAULT, DBUSMENU_MENUITEM_PROP_SHORTCUT, G_VARIANT_TYPE("aas"), NULL);
89 dbusmenu_defaults_default_set(self, DBUSMENU_CLIENT_TYPES_DEFAULT, DBUSMENU_MENUITEM_PROP_CHILD_DISPLAY, G_VARIANT_TYPE_STRING, NULL); 89 dbusmenu_defaults_default_set(self, DBUSMENU_CLIENT_TYPES_DEFAULT, DBUSMENU_MENUITEM_PROP_CHILD_DISPLAY, G_VARIANT_TYPE_STRING, NULL);
9090
91 /* Separator defaults */91 /* Separator defaults */
9292
=== modified file 'libdbusmenu-gtk/menuitem.c'
--- libdbusmenu-gtk/menuitem.c 2011-03-21 16:06:57 +0000
+++ libdbusmenu-gtk/menuitem.c 2011-03-31 18:59:23 +0000
@@ -275,6 +275,17 @@
275void275void
276dbusmenu_menuitem_property_get_shortcut (DbusmenuMenuitem * menuitem, guint * key, GdkModifierType * modifier)276dbusmenu_menuitem_property_get_shortcut (DbusmenuMenuitem * menuitem, guint * key, GdkModifierType * modifier)
277{277{
278 guint dummykey;
279 GdkModifierType dummymodifier;
280
281 if (key == NULL) {
282 key = &dummykey;
283 }
284
285 if (modifier == NULL) {
286 modifier = &dummymodifier;
287 }
288
278 *key = 0;289 *key = 0;
279 *modifier = 0;290 *modifier = 0;
280291
@@ -287,15 +298,15 @@
287298
288 if (g_variant_n_children(wrapper) != 1) {299 if (g_variant_n_children(wrapper) != 1) {
289 g_warning("Unable to parse shortcut, too many keys");300 g_warning("Unable to parse shortcut, too many keys");
290 g_variant_unref(wrapper);
291 return;301 return;
292 }302 }
293303
294 GVariantIter iter;304 GVariantIter iter;
295 g_variant_iter_init(&iter, g_variant_get_child_value(wrapper, 0));305 GVariant * child = g_variant_get_child_value(wrapper, 0);
306 g_variant_iter_init(&iter, child);
296 gchar * string;307 gchar * string;
297308
298 while(g_variant_iter_next(&iter, "s", &string)) {309 while(g_variant_iter_loop(&iter, "s", &string)) {
299 if (g_strcmp0(string, DBUSMENU_MENUITEM_SHORTCUT_CONTROL) == 0) {310 if (g_strcmp0(string, DBUSMENU_MENUITEM_SHORTCUT_CONTROL) == 0) {
300 *modifier |= GDK_CONTROL_MASK;311 *modifier |= GDK_CONTROL_MASK;
301 } else if (g_strcmp0(string, DBUSMENU_MENUITEM_SHORTCUT_ALT) == 0) {312 } else if (g_strcmp0(string, DBUSMENU_MENUITEM_SHORTCUT_ALT) == 0) {
@@ -308,10 +319,10 @@
308 GdkModifierType tempmod;319 GdkModifierType tempmod;
309 gtk_accelerator_parse(string, key, &tempmod);320 gtk_accelerator_parse(string, key, &tempmod);
310 }321 }
311
312 g_free(string);
313 }322 }
314323
324 g_variant_unref(child);
325
315 return;326 return;
316}327}
317328
318329
=== modified file 'libdbusmenu-gtk/parser.c'
--- libdbusmenu-gtk/parser.c 2011-03-21 14:03:18 +0000
+++ libdbusmenu-gtk/parser.c 2011-03-31 18:59:23 +0000
@@ -454,7 +454,7 @@
454454
455 gboolean visible = FALSE;455 gboolean visible = FALSE;
456 gboolean sensitive = FALSE;456 gboolean sensitive = FALSE;
457 if (GTK_IS_SEPARATOR_MENU_ITEM (widget))457 if (GTK_IS_SEPARATOR_MENU_ITEM (widget) || !find_menu_label (widget))
458 {458 {
459 dbusmenu_menuitem_property_set (mi,459 dbusmenu_menuitem_property_set (mi,
460 "type",460 "type",
@@ -512,21 +512,18 @@
512512
513 GtkWidget *label = find_menu_label (widget);513 GtkWidget *label = find_menu_label (widget);
514514
515 if (label)515 // Sometimes, an app will directly find and modify the label
516 {516 // (like empathy), so watch the label especially for that.
517 // Sometimes, an app will directly find and modify the label517 gchar * text = sanitize_label (GTK_LABEL (label));
518 // (like empathy), so watch the label especially for that.518 dbusmenu_menuitem_property_set (mi, "label", text);
519 gchar * text = sanitize_label (GTK_LABEL (label));519 g_free (text);
520 dbusmenu_menuitem_property_set (mi, "label", text);
521 g_free (text);
522520
523 pdata->label = label;521 pdata->label = label;
524 g_signal_connect (G_OBJECT (label),522 g_signal_connect (G_OBJECT (label),
525 "notify",523 "notify",
526 G_CALLBACK (label_notify_cb),524 G_CALLBACK (label_notify_cb),
527 mi);525 mi);
528 g_object_add_weak_pointer(G_OBJECT (label), (gpointer*)&pdata->label);526 g_object_add_weak_pointer(G_OBJECT (label), (gpointer*)&pdata->label);
529 }
530527
531 if (GTK_IS_ACTIVATABLE (widget))528 if (GTK_IS_ACTIVATABLE (widget))
532 {529 {
@@ -760,11 +757,48 @@
760}757}
761758
762static void759static void
760recreate_menu_item (DbusmenuMenuitem * parent, DbusmenuMenuitem * child)
761{
762 if (parent == NULL)
763 {
764 /* We need a parent */
765 return;
766 }
767 ParserData * pdata = g_object_get_data (G_OBJECT (child), PARSER_DATA);
768 /* Keep a pointer to the GtkMenuItem, as pdata->widget might be
769 * invalidated when we delete the DbusmenuMenuitem
770 */
771 GtkWidget * menuitem = pdata->widget;
772
773 dbusmenu_menuitem_child_delete (parent, child);
774
775 RecurseContext recurse = {0};
776 recurse.toplevel = gtk_widget_get_toplevel(menuitem);
777 recurse.parent = parent;
778
779 parse_menu_structure_helper(menuitem, &recurse);
780}
781
782static gboolean
783recreate_menu_item_in_idle_cb (gpointer data)
784{
785 DbusmenuMenuitem * child = (DbusmenuMenuitem *)data;
786 DbusmenuMenuitem * parent = dbusmenu_menuitem_get_parent (child);
787 g_object_unref (child);
788 recreate_menu_item (parent, child);
789 return FALSE;
790}
791
792static void
763label_notify_cb (GtkWidget *widget,793label_notify_cb (GtkWidget *widget,
764 GParamSpec *pspec,794 GParamSpec *pspec,
765 gpointer data)795 gpointer data)
766{796{
767 DbusmenuMenuitem *child = (DbusmenuMenuitem *)data;797 DbusmenuMenuitem *child = (DbusmenuMenuitem *)data;
798 GValue prop_value = {0};
799
800 g_value_init (&prop_value, pspec->value_type);
801 g_object_get_property (G_OBJECT (widget), pspec->name, &prop_value);
768802
769 if (pspec->name == g_intern_static_string ("label"))803 if (pspec->name == g_intern_static_string ("label"))
770 {804 {
@@ -774,6 +808,24 @@
774 text);808 text);
775 g_free (text);809 g_free (text);
776 }810 }
811 else if (pspec->name == g_intern_static_string ("parent"))
812 {
813 if (GTK_WIDGET (g_value_get_object (&prop_value)) == NULL)
814 {
815 /* This label is being removed from its GtkMenuItem. The
816 * menuitem becomes a separator now. As the client doesn't handle
817 * changing types so well, we remove the current DbusmenuMenuitem
818 * and add a new one.
819 *
820 * Note, we have to defer this to idle, as we are called before
821 * bin->child member of our old parent is invalidated. If we go ahead
822 * and call parse_menu_structure_helper now, the GtkMenuItem will
823 * still appear to have a label and we never convert it to a separator
824 */
825 g_object_ref (child);
826 g_idle_add ((GSourceFunc)recreate_menu_item_in_idle_cb, child);
827 }
828 }
777}829}
778830
779static void831static void
@@ -891,6 +943,20 @@
891 }943 }
892 else if (pspec->name == g_intern_static_string ("label"))944 else if (pspec->name == g_intern_static_string ("label"))
893 {945 {
946 ParserData *pdata = g_object_get_data (G_OBJECT (child), PARSER_DATA);
947 if (!pdata->label)
948 {
949 /* GtkMenuItem's can start life as a separator if they have no child
950 * GtkLabel. In this case, we need to convert the DbusmenuMenuitem from
951 * a separator to a normal menuitem if the application adds a label.
952 * As changing types isn't handled too well by the client, we delete
953 * this menuitem for now and then recreate it
954 */
955 DbusmenuMenuitem * parent = dbusmenu_menuitem_get_parent (child);
956 recreate_menu_item (parent, child);
957 return;
958 }
959
894 dbusmenu_menuitem_property_set (child,960 dbusmenu_menuitem_property_set (child,
895 DBUSMENU_MENUITEM_PROP_LABEL,961 DBUSMENU_MENUITEM_PROP_LABEL,
896 g_value_get_string (&prop_value));962 g_value_get_string (&prop_value));
897963
=== modified file 'ltmain.sh'
--- ltmain.sh 2011-02-17 17:04:40 +0000
+++ ltmain.sh 2011-03-31 18:59:23 +0000
@@ -65,7 +65,7 @@
65# compiler: $LTCC65# compiler: $LTCC
66# compiler flags: $LTCFLAGS66# compiler flags: $LTCFLAGS
67# linker: $LD (gnu? $with_gnu_ld)67# linker: $LD (gnu? $with_gnu_ld)
68# $progname: (GNU libtool) 2.2.6b Debian-2.2.6b-2ubuntu268# $progname: (GNU libtool) 2.2.6b Debian-2.2.6b-2ubuntu3
69# automake: $automake_version69# automake: $automake_version
70# autoconf: $autoconf_version70# autoconf: $autoconf_version
71#71#
@@ -73,7 +73,7 @@
7373
74PROGRAM=ltmain.sh74PROGRAM=ltmain.sh
75PACKAGE=libtool75PACKAGE=libtool
76VERSION="2.2.6b Debian-2.2.6b-2ubuntu2"76VERSION="2.2.6b Debian-2.2.6b-2ubuntu3"
77TIMESTAMP=""77TIMESTAMP=""
78package_revision=1.301778package_revision=1.3017
7979

Subscribers

People subscribed via source and target branches

to all changes: