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

Proposed by Ted Gould
Status: Merged
Merged at revision: 144
Proposed branch: lp:~dbusmenu-team/libdbusmenu/ubuntu
Merge into: lp:~ubuntu-desktop/libdbusmenu/ubuntu
Diff against target: 527 lines (+152/-62)
14 files modified
ChangeLog (+56/-0)
configure (+11/-11)
configure.ac (+3/-3)
debian/changelog (+11/-2)
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-menuitem.c (+1/-1)
libdbusmenu-glib/client-private.h (+2/-1)
libdbusmenu-glib/client.c (+1/-2)
libdbusmenu-gtk/client.c (+6/-25)
libdbusmenu-gtk/menu.c (+14/-0)
libdbusmenu-gtk/parser.c (+43/-13)
To merge this branch: bzr merge lp:~dbusmenu-team/libdbusmenu/ubuntu
Reviewer Review Type Date Requested Status
Ken VanDine Pending
Review via email: mp+57791@code.launchpad.net

Description of the change

Last one!

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

releasing version 0.4.3-0ubuntu1

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'ChangeLog'
--- ChangeLog 2011-04-07 15:24:32 +0000
+++ ChangeLog 2011-04-14 21:52:53 +0000
@@ -1,5 +1,61 @@
1# Generated by Makefile. Do not edit.1# Generated by Makefile. Do not edit.
22
32011-04-14 Ted Gould <ted@gould.cx>
4
5 0.4.3
6
72011-04-12 Ted Gould <ted@gould.cx>
8
9 Handle cases of labels being added later
10
112011-04-12 Michael Terry <mike@mterry.name>
12
13 watch empty/separator menu items for any added GtkLabel children, as gnome-commander likes to do
14
152011-04-12 Ted Gould <ted@gould.cx>
16
17 Changing the cleanup of GTK Menuitems to avoid undefined references.
18
192011-04-10 Ted Gould <ted@gould.cx>
20
21 Ensuring all the menus are hidden before unref'ing root
22
232011-04-10 Ted Gould <ted@gould.cx>
24
25 Passing the menuitem instead of finding it.
26
272011-04-10 Ted Gould <ted@gould.cx>
28
29 Protecting the label with the null check and don't unref something that shouldn't be.
30
312011-04-10 Ted Gould <ted@gould.cx>
32
33 Attaching the data in a way that it'll cleanup itself
34
352011-04-07 Ted Gould <ted@gould.cx>
36
37 Attaching bug
38
392011-04-07 Ted Gould <ted@gould.cx>
40
41 We have to destroy, why? Because we want to make sure that the menu having a ref doesn't block us from getting rid of the item.
42
432011-04-07 Ted Gould <ted@gould.cx>
44
45 Switching the reference to the GTK Menuitem to be a _sink as well as using set_data_full() instead of a weak ref for unref'ing it.
46
472011-04-12 Ted Gould <ted@gould.cx>
48
49 Ensure that we gaurantee the open/clicked/closed event ordering.
50
512011-04-08 Michael Terry <mike@mterry.name>
52
53 guard against an activation that does not actually have an associated menu-hide
54
552011-04-07 Michael Terry <mike@mterry.name>
56
57 force activated event to be sandwiched by opened/closed events
58
32011-04-07 Ted Gould <ted@gould.cx>592011-04-07 Ted Gould <ted@gould.cx>
460
5 0.4.261 0.4.2
662
=== modified file 'configure'
--- configure 2011-04-07 15:26:05 +0000
+++ configure 2011-04-14 21:52:53 +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.2.3# Generated by GNU Autoconf 2.67 for libdbusmenu 0.4.3.
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.2'706PACKAGE_VERSION='0.4.3'
707PACKAGE_STRING='libdbusmenu 0.4.2'707PACKAGE_STRING='libdbusmenu 0.4.3'
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.2 to adapt to many kinds of systems.1544\`configure' configures libdbusmenu 0.4.3 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.2:";;1614 short | recursive ) echo "Configuration of libdbusmenu 0.4.3:";;
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.21754libdbusmenu configure 0.4.3
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.2, which was2125It was created by libdbusmenu $as_me 0.4.3, 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.22946 VERSION=0.4.3
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=1313297LIBDBUSMENU_REVISION=14
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.2, which was14619This file was extended by libdbusmenu $as_me 0.4.3, 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.214685libdbusmenu config.status 0.4.3
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-04-07 15:26:05 +0000
+++ configure.ac 2011-04-14 21:52:53 +0000
@@ -1,11 +1,11 @@
11
2AC_INIT(libdbusmenu, 0.4.2, ted@canonical.com)2AC_INIT(libdbusmenu, 0.4.3, 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.2, [-Wno-portability])8AM_INIT_AUTOMAKE(libdbusmenu, 0.4.3, [-Wno-portability])
99
10AM_MAINTAINER_MODE10AM_MAINTAINER_MODE
1111
@@ -134,7 +134,7 @@
134###########################134###########################
135135
136LIBDBUSMENU_CURRENT=3136LIBDBUSMENU_CURRENT=3
137LIBDBUSMENU_REVISION=13137LIBDBUSMENU_REVISION=14
138LIBDBUSMENU_AGE=0138LIBDBUSMENU_AGE=0
139139
140AC_SUBST(LIBDBUSMENU_CURRENT)140AC_SUBST(LIBDBUSMENU_CURRENT)
141141
=== modified file 'debian/changelog'
--- debian/changelog 2011-04-14 13:30:12 +0000
+++ debian/changelog 2011-04-14 21:52:53 +0000
@@ -1,5 +1,6 @@
1libdbusmenu (0.4.2-0ubuntu4) UNRELEASED; urgency=low1libdbusmenu (0.4.3-0ubuntu1~ppa1) natty; urgency=low
22
3 [ Ken VanDine ]
3 * debian/rules4 * debian/rules
4 - Fixed package names in build targets (LP: #760102)5 - Fixed package names in build targets (LP: #760102)
5 - Dropped makeshlibs in favor of symbols files6 - Dropped makeshlibs in favor of symbols files
@@ -7,7 +8,15 @@
7 * +debian/libdbusmenu-gtk3-3.symbols8 * +debian/libdbusmenu-gtk3-3.symbols
8 * +debian/libdbusmenu-gtk3.symbols9 * +debian/libdbusmenu-gtk3.symbols
910
10 -- Ken VanDine <ken.vandine@canonical.com> Thu, 14 Apr 2011 09:27:03 -040011 [ Ted Gould ]
12 * New upstream release.
13 ∘ Handle cases where labels are added later as subwidgets
14 in the menuitem (LP: #758759)
15 ∘ Fix the destruction of the attached GTK menuitem (LP: #746091)
16 ∘ Guard against an activation that does not actually have an
17 associated menu-hide (LP: #750588)
18
19 -- Ted Gould <ted@ubuntu.com> Thu, 14 Apr 2011 16:49:13 -0500
1120
12libdbusmenu (0.4.2-0ubuntu3) natty; urgency=low21libdbusmenu (0.4.2-0ubuntu3) natty; urgency=low
1322
1423
=== modified file 'docs/libdbusmenu-glib/reference/html/ch01.html'
--- docs/libdbusmenu-glib/reference/html/ch01.html 2011-04-07 15:24:32 +0000
+++ docs/libdbusmenu-glib/reference/html/ch01.html 2011-04-14 21:52:53 +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="id552681"></a>API</h2></div></div></div>24<a name="id540461"></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-04-07 15:26:05 +0000
+++ docs/libdbusmenu-glib/reference/version.xml 2011-04-14 21:52:53 +0000
@@ -1,1 +1,1 @@
10.4.210.4.3
22
=== modified file 'docs/libdbusmenu-gtk/reference/html/ch01.html'
--- docs/libdbusmenu-gtk/reference/html/ch01.html 2011-04-07 15:24:32 +0000
+++ docs/libdbusmenu-gtk/reference/html/ch01.html 2011-04-14 21:52:53 +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="id463422"></a>API</h2></div></div></div>24<a name="id403245"></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-04-07 15:26:05 +0000
+++ docs/libdbusmenu-gtk/reference/version.xml 2011-04-14 21:52:53 +0000
@@ -1,1 +1,1 @@
10.4.210.4.3
22
=== modified file 'libdbusmenu-glib/client-menuitem.c'
--- libdbusmenu-glib/client-menuitem.c 2011-02-21 18:55:10 +0000
+++ libdbusmenu-glib/client-menuitem.c 2011-04-14 21:52:53 +0000
@@ -106,7 +106,7 @@
106handle_event (DbusmenuMenuitem * mi, const gchar * name, GVariant * variant, guint timestamp)106handle_event (DbusmenuMenuitem * mi, const gchar * name, GVariant * variant, guint timestamp)
107{107{
108 DbusmenuClientMenuitemPrivate * priv = DBUSMENU_CLIENT_MENUITEM_GET_PRIVATE(mi);108 DbusmenuClientMenuitemPrivate * priv = DBUSMENU_CLIENT_MENUITEM_GET_PRIVATE(mi);
109 dbusmenu_client_send_event(priv->client, dbusmenu_menuitem_get_id(mi), name, variant, timestamp);109 dbusmenu_client_send_event(priv->client, dbusmenu_menuitem_get_id(mi), name, variant, timestamp, mi);
110 return;110 return;
111}111}
112112
113113
=== modified file 'libdbusmenu-glib/client-private.h'
--- libdbusmenu-glib/client-private.h 2011-02-21 18:55:10 +0000
+++ libdbusmenu-glib/client-private.h 2011-04-14 21:52:53 +0000
@@ -37,7 +37,8 @@
37 gint id,37 gint id,
38 const gchar * name,38 const gchar * name,
39 GVariant * variant,39 GVariant * variant,
40 guint timestamp);40 guint timestamp,
41 DbusmenuMenuitem * mi);
41void dbusmenu_client_send_about_to_show(DbusmenuClient * client,42void dbusmenu_client_send_about_to_show(DbusmenuClient * client,
42 gint id,43 gint id,
43 void (*cb) (gpointer user_data),44 void (*cb) (gpointer user_data),
4445
=== modified file 'libdbusmenu-glib/client.c'
--- libdbusmenu-glib/client.c 2011-04-07 15:26:05 +0000
+++ libdbusmenu-glib/client.c 2011-04-14 21:52:53 +0000
@@ -1516,14 +1516,13 @@
1516/* Sends the event over DBus to the server on the other side1516/* Sends the event over DBus to the server on the other side
1517 of the bus. */1517 of the bus. */
1518void1518void
1519dbusmenu_client_send_event (DbusmenuClient * client, gint id, const gchar * name, GVariant * variant, guint timestamp)1519dbusmenu_client_send_event (DbusmenuClient * client, gint id, const gchar * name, GVariant * variant, guint timestamp, DbusmenuMenuitem * mi)
1520{1520{
1521 g_return_if_fail(DBUSMENU_IS_CLIENT(client));1521 g_return_if_fail(DBUSMENU_IS_CLIENT(client));
1522 g_return_if_fail(id >= 0);1522 g_return_if_fail(id >= 0);
1523 g_return_if_fail(name != NULL);1523 g_return_if_fail(name != NULL);
15241524
1525 DbusmenuClientPrivate * priv = DBUSMENU_CLIENT_GET_PRIVATE(client);1525 DbusmenuClientPrivate * priv = DBUSMENU_CLIENT_GET_PRIVATE(client);
1526 DbusmenuMenuitem * mi = dbusmenu_menuitem_find_id(priv->root, id);
1527 if (mi == NULL) {1526 if (mi == NULL) {
1528 g_warning("Asked to activate a menuitem %d that we don't know about", id);1527 g_warning("Asked to activate a menuitem %d that we don't know about", id);
1529 return;1528 return;
15301529
=== modified file 'libdbusmenu-gtk/client.c'
--- libdbusmenu-gtk/client.c 2011-04-08 21:23:37 +0000
+++ libdbusmenu-gtk/client.c 2011-04-14 21:52:53 +0000
@@ -690,7 +690,8 @@
690 } else {690 } else {
691 /* We need to build a menu for these guys to live in. */691 /* We need to build a menu for these guys to live in. */
692 GtkMenu * menu = GTK_MENU(gtk_menu_new());692 GtkMenu * menu = GTK_MENU(gtk_menu_new());
693 g_object_set_data(G_OBJECT(mi), data_menu, menu);693 g_object_ref_sink(menu);
694 g_object_set_data_full(G_OBJECT(mi), data_menu, menu, g_object_unref);
694695
695 gtk_menu_item_set_submenu(gmi, GTK_WIDGET(menu));696 gtk_menu_item_set_submenu(gmi, GTK_WIDGET(menu));
696697
@@ -735,19 +736,6 @@
735 return;736 return;
736}737}
737738
738/* Call back that happens when the DbusmenuMenuitem
739 is destroyed. We're making sure to clean up everything
740 else down the pipe. */
741static void
742destoryed_dbusmenuitem_cb (gpointer udata, GObject * dbusmenuitem)
743{
744 #ifdef MASSIVEDEBUGGING
745 g_debug("DbusmenuMenuitem was destroyed");
746 #endif
747 gtk_widget_destroy(GTK_WIDGET(udata));
748 return;
749}
750
751/* The new menuitem signal only happens if we don't have a type handler739/* The new menuitem signal only happens if we don't have a type handler
752 for the type of the item. This should be an error condition and we're740 for the type of the item. This should be an error condition and we're
753 printing out a message. */741 printing out a message. */
@@ -850,11 +838,8 @@
850 #endif838 #endif
851839
852 /* Attach these two */840 /* Attach these two */
853 g_object_set_data(G_OBJECT(item), data_menuitem, gmi);841 g_object_ref_sink(G_OBJECT(gmi));
854 g_object_ref(G_OBJECT(gmi));842 g_object_set_data_full(G_OBJECT(item), data_menuitem, gmi, (GDestroyNotify)gtk_widget_destroy);
855 #ifdef MASSIVEDEBUGGING
856 g_signal_connect(G_OBJECT(gmi), "destroy", G_CALLBACK(destroy_gmi), item);
857 #endif
858843
859 /* DbusmenuMenuitem signals */844 /* DbusmenuMenuitem signals */
860 g_signal_connect(G_OBJECT(item), DBUSMENU_MENUITEM_SIGNAL_PROPERTY_CHANGED, G_CALLBACK(menu_prop_change_cb), client);845 g_signal_connect(G_OBJECT(item), DBUSMENU_MENUITEM_SIGNAL_PROPERTY_CHANGED, G_CALLBACK(menu_prop_change_cb), client);
@@ -865,9 +850,6 @@
865 /* GtkMenuitem signals */850 /* GtkMenuitem signals */
866 g_signal_connect(G_OBJECT(gmi), "activate", G_CALLBACK(menu_pressed_cb), item);851 g_signal_connect(G_OBJECT(gmi), "activate", G_CALLBACK(menu_pressed_cb), item);
867852
868 /* Life insurance */
869 g_object_weak_ref(G_OBJECT(item), destoryed_dbusmenuitem_cb, gmi);
870
871 /* Check our set of props to see if any are set already */853 /* Check our set of props to see if any are set already */
872 process_visible(item, gmi, dbusmenu_menuitem_property_get_variant(item, DBUSMENU_MENUITEM_PROP_VISIBLE));854 process_visible(item, gmi, dbusmenu_menuitem_property_get_variant(item, DBUSMENU_MENUITEM_PROP_VISIBLE));
873 process_sensitive(item, gmi, dbusmenu_menuitem_property_get_variant(item, DBUSMENU_MENUITEM_PROP_ENABLED));855 process_sensitive(item, gmi, dbusmenu_menuitem_property_get_variant(item, DBUSMENU_MENUITEM_PROP_ENABLED));
@@ -920,7 +902,7 @@
920902
921 if (menu != NULL) {903 if (menu != NULL) {
922 gtk_widget_destroy(GTK_WIDGET(menu));904 gtk_widget_destroy(GTK_WIDGET(menu));
923 g_object_set_data(G_OBJECT(mi), data_menu, NULL);905 g_object_steal_data(G_OBJECT(mi), data_menu);
924 }906 }
925 }907 }
926908
@@ -1024,11 +1006,10 @@
10241006
1025 GtkMenuItem * gmi;1007 GtkMenuItem * gmi;
1026 gmi = GTK_MENU_ITEM(g_object_new(GENERICMENUITEM_TYPE, NULL));1008 gmi = GTK_MENU_ITEM(g_object_new(GENERICMENUITEM_TYPE, NULL));
1027 gtk_menu_item_set_label(gmi, dbusmenu_menuitem_property_get(newitem, DBUSMENU_MENUITEM_PROP_LABEL));
10281009
1029 if (gmi != NULL) {1010 if (gmi != NULL) {
1011 gtk_menu_item_set_label(gmi, dbusmenu_menuitem_property_get(newitem, DBUSMENU_MENUITEM_PROP_LABEL));
1030 dbusmenu_gtkclient_newitem_base(DBUSMENU_GTKCLIENT(client), newitem, gmi, parent);1012 dbusmenu_gtkclient_newitem_base(DBUSMENU_GTKCLIENT(client), newitem, gmi, parent);
1031 g_object_unref(gmi);
1032 } else {1013 } else {
1033 return FALSE;1014 return FALSE;
1034 }1015 }
10351016
=== modified file 'libdbusmenu-gtk/menu.c'
--- libdbusmenu-gtk/menu.c 2011-02-21 20:13:29 +0000
+++ libdbusmenu-gtk/menu.c 2011-04-14 21:52:53 +0000
@@ -329,6 +329,18 @@
329 return;329 return;
330}330}
331331
332/* Handler for all of the menu items on a root change to ensure that
333 the menus are hidden before we start going and deleting things. */
334static void
335popdown_all (DbusmenuMenuitem * mi, gpointer user_data)
336{
337 GtkMenu * menu = dbusmenu_gtkclient_menuitem_get_submenu(DBUSMENU_GTKCLIENT(user_data), mi);
338 if (menu != NULL) {
339 gtk_menu_popdown(menu);
340 }
341 return;
342}
343
332/* When the root menuitem changes we need to resetup things so that344/* When the root menuitem changes we need to resetup things so that
333 we're back in the game. */345 we're back in the game. */
334static void346static void
@@ -344,6 +356,8 @@
344 g_signal_handlers_disconnect_by_func(G_OBJECT(priv->root), root_child_moved, menu);356 g_signal_handlers_disconnect_by_func(G_OBJECT(priv->root), root_child_moved, menu);
345 g_signal_handlers_disconnect_by_func(G_OBJECT(priv->root), root_child_delete, menu);357 g_signal_handlers_disconnect_by_func(G_OBJECT(priv->root), root_child_delete, menu);
346358
359 dbusmenu_menuitem_foreach(priv->root, popdown_all, client);
360
347 g_object_unref(priv->root);361 g_object_unref(priv->root);
348 priv->root = NULL;362 priv->root = NULL;
349 }363 }
350364
=== modified file 'libdbusmenu-gtk/parser.c'
--- libdbusmenu-gtk/parser.c 2011-04-05 21:20:54 +0000
+++ libdbusmenu-gtk/parser.c 2011-04-14 21:52:53 +0000
@@ -87,6 +87,9 @@
87static void widget_notify_cb (GtkWidget * widget,87static void widget_notify_cb (GtkWidget * widget,
88 GParamSpec * pspec,88 GParamSpec * pspec,
89 gpointer data);89 gpointer data);
90static void widget_add_cb (GtkWidget * widget,
91 GtkWidget * child,
92 gpointer data);
90static gboolean should_show_image (GtkImage * image);93static gboolean should_show_image (GtkImage * image);
91static void menuitem_notify_cb (GtkWidget * widget,94static void menuitem_notify_cb (GtkWidget * widget,
92 GParamSpec * pspec,95 GParamSpec * pspec,
@@ -169,6 +172,8 @@
169 g_signal_handlers_disconnect_matched(pdata->widget, (GSignalMatchType)G_SIGNAL_MATCH_FUNC,172 g_signal_handlers_disconnect_matched(pdata->widget, (GSignalMatchType)G_SIGNAL_MATCH_FUNC,
170 0, 0, NULL, G_CALLBACK(widget_notify_cb), NULL);173 0, 0, NULL, G_CALLBACK(widget_notify_cb), NULL);
171 g_signal_handlers_disconnect_matched(pdata->widget, (GSignalMatchType)G_SIGNAL_MATCH_FUNC,174 g_signal_handlers_disconnect_matched(pdata->widget, (GSignalMatchType)G_SIGNAL_MATCH_FUNC,
175 0, 0, NULL, G_CALLBACK(widget_add_cb), NULL);
176 g_signal_handlers_disconnect_matched(pdata->widget, (GSignalMatchType)G_SIGNAL_MATCH_FUNC,
172 0, 0, NULL, G_CALLBACK(accel_changed), NULL);177 0, 0, NULL, G_CALLBACK(accel_changed), NULL);
173 g_signal_handlers_disconnect_matched(pdata->widget, (GSignalMatchType)G_SIGNAL_MATCH_FUNC,178 g_signal_handlers_disconnect_matched(pdata->widget, (GSignalMatchType)G_SIGNAL_MATCH_FUNC,
174 0, 0, NULL, G_CALLBACK(checkbox_toggled), NULL);179 0, 0, NULL, G_CALLBACK(checkbox_toggled), NULL);
@@ -462,8 +467,8 @@
462 if (GTK_IS_SEPARATOR_MENU_ITEM (widget) || !find_menu_label (widget))467 if (GTK_IS_SEPARATOR_MENU_ITEM (widget) || !find_menu_label (widget))
463 {468 {
464 dbusmenu_menuitem_property_set (mi,469 dbusmenu_menuitem_property_set (mi,
465 "type",470 DBUSMENU_MENUITEM_PROP_TYPE,
466 "separator");471 DBUSMENU_CLIENT_TYPES_SEPARATOR);
467472
468 visible = gtk_widget_get_visible (widget);473 visible = gtk_widget_get_visible (widget);
469 sensitive = gtk_widget_get_sensitive (widget);474 sensitive = gtk_widget_get_sensitive (widget);
@@ -605,6 +610,11 @@
605 G_CALLBACK (widget_notify_cb),610 G_CALLBACK (widget_notify_cb),
606 mi);611 mi);
607612
613 g_signal_connect (widget,
614 "add",
615 G_CALLBACK (widget_add_cb),
616 mi);
617
608 return mi;618 return mi;
609 }619 }
610620
@@ -962,6 +972,26 @@
962 return FALSE; // just pass through on everything972 return FALSE; // just pass through on everything
963}973}
964974
975static gboolean
976handle_first_label (DbusmenuMenuitem *mi)
977{
978 ParserData *pdata = g_object_get_data (G_OBJECT (mi), PARSER_DATA);
979 if (!pdata->label)
980 {
981 /* GtkMenuItem's can start life as a separator if they have no child
982 * GtkLabel. In this case, we need to convert the DbusmenuMenuitem from
983 * a separator to a normal menuitem if the application adds a label.
984 * As changing types isn't handled too well by the client, we delete
985 * this menuitem for now and then recreate it
986 */
987 DbusmenuMenuitem * parent = dbusmenu_menuitem_get_parent (mi);
988 recreate_menu_item (parent, mi);
989 return TRUE;
990 }
991
992 return FALSE;
993}
994
965static void995static void
966widget_notify_cb (GtkWidget *widget,996widget_notify_cb (GtkWidget *widget,
967 GParamSpec *pspec,997 GParamSpec *pspec,
@@ -981,20 +1011,11 @@
981 }1011 }
982 else if (pspec->name == g_intern_static_string ("label"))1012 else if (pspec->name == g_intern_static_string ("label"))
983 {1013 {
984 ParserData *pdata = g_object_get_data (G_OBJECT (child), PARSER_DATA);1014 if (handle_first_label (child))
985 if (!pdata->label)
986 {1015 {
987 /* GtkMenuItem's can start life as a separator if they have no child
988 * GtkLabel. In this case, we need to convert the DbusmenuMenuitem from
989 * a separator to a normal menuitem if the application adds a label.
990 * As changing types isn't handled too well by the client, we delete
991 * this menuitem for now and then recreate it
992 */
993 DbusmenuMenuitem * parent = dbusmenu_menuitem_get_parent (child);
994 recreate_menu_item (parent, child);
995 return;1016 return;
996 }1017 }
997 1018
998 dbusmenu_menuitem_property_set (child,1019 dbusmenu_menuitem_property_set (child,
999 DBUSMENU_MENUITEM_PROP_LABEL,1020 DBUSMENU_MENUITEM_PROP_LABEL,
1000 g_value_get_string (&prop_value));1021 g_value_get_string (&prop_value));
@@ -1066,6 +1087,15 @@
1066 g_value_unset (&prop_value);1087 g_value_unset (&prop_value);
1067}1088}
10681089
1090static void
1091widget_add_cb (GtkWidget *widget,
1092 GtkWidget *child,
1093 gpointer data)
1094{
1095 if (find_menu_label (child) != NULL)
1096 handle_first_label (data);
1097}
1098
1069/* A child item was added to a menu we're watching. Let's try to integrate it. */1099/* A child item was added to a menu we're watching. Let's try to integrate it. */
1070static void1100static void
1071child_added_cb (GtkContainer *menu, GtkWidget *widget, gpointer data)1101child_added_cb (GtkContainer *menu, GtkWidget *widget, gpointer data)

Subscribers

People subscribed via source and target branches

to all changes: