aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTed Gould <ted@gould.cx>2011-03-31 13:48:12 -0500
committerTed Gould <ted@gould.cx>2011-03-31 13:48:12 -0500
commit269670511328aada39a23bd982a1ca3a44de9cfe (patch)
tree48a6c86d5e51e3b7ec2f0c9446115c2142e8cd8a
parent53691e5c73a343fec78e6782089e092bd6bcd3ac (diff)
parentf90465d8892aff9002874ae40656b3c67a2542af (diff)
downloadlibdbusmenu-269670511328aada39a23bd982a1ca3a44de9cfe.tar.gz
libdbusmenu-269670511328aada39a23bd982a1ca3a44de9cfe.tar.bz2
libdbusmenu-269670511328aada39a23bd982a1ca3a44de9cfe.zip
Import upstream version 0.4.1
-rw-r--r--ChangeLog78
-rwxr-xr-xconfigure22
-rw-r--r--configure.ac6
-rw-r--r--docs/libdbusmenu-glib/reference/html/ch01.html2
-rw-r--r--docs/libdbusmenu-glib/reference/version.xml2
-rw-r--r--docs/libdbusmenu-gtk/reference/html/ch01.html2
-rw-r--r--docs/libdbusmenu-gtk/reference/version.xml2
-rw-r--r--libdbusmenu-glib/client.c37
-rw-r--r--libdbusmenu-glib/defaults.c4
-rw-r--r--libdbusmenu-gtk/menuitem.c21
-rw-r--r--libdbusmenu-gtk/parser.c98
-rwxr-xr-xltmain.sh4
12 files changed, 226 insertions, 52 deletions
diff --git a/ChangeLog b/ChangeLog
index defc97e..2564e02 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,83 @@
# Generated by Makefile. Do not edit.
+2011-03-31 Ted Gould <ted@gould.cx>
+
+ 0.4.1
+
+2011-03-31 Ted Gould <ted@gould.cx>
+
+ Ensuring that our iterators have variants to reference and ref'ing them correctly.
+
+2011-03-29 Ted Gould <ted@gould.cx>
+
+ Be more specific about the shortcut type
+
+2011-03-29 Ted Gould <ted@gould.cx>
+
+ Split out into another variable
+
+2011-03-28 Ted Gould <ted@gould.cx>
+
+ Use loop instead of next
+
+2011-03-28 Ted Gould <ted@gould.cx>
+
+ Putting in some protections from NULL parameters.
+
+2011-03-28 Ted Gould <ted@gould.cx>
+
+ Don't unref a variant we didn't have a ref to on error
+
+2011-03-31 Ted Gould <ted@gould.cx>
+
+ Turning GTK Menuitems without labels into separators.
+
+2011-03-30 Chris Coulson <chrisccoulson@ubuntu.com>
+
+ Remove some code duplication introduced in this branch
+
+2011-03-30 Chris Coulson <chrisccoulson@ubuntu.com>
+
+ - Don't change the type of existing menu items in the server. This
+ isn't handled in the client too well
+ - Handle a GtkMenuItem's GtkLabel being removed too
+
+2011-03-30 Chris Coulson <chrisccoulson@ubuntu.com>
+
+ Remove the now unneeded null pointer check on label in construct_dbusmenu_for_widget.
+ Also, don't use a strcmp in widget_notify_cb for checking if the menuitem is a separator. Just do a null pointer
+ check on pdata->label instead
+
+2011-03-30 Chris Coulson <chrisccoulson@ubuntu.com>
+
+ Revert the last commit and handle the same problem in the parser instead
+
+2011-03-29 Chris Coulson <chrisccoulson@ubuntu.com>
+
+ Don't set a default label for menuitems. Some applications (eg, xchat and pidgin) do silly things like
+ creating GtkMenuItems's without a label for separators (rather than using the GtkSeparatorMenuItem class).
+ GTK correctly renders these as separators, so we need to handle it too by not setting a default label on these
+
+2011-03-28 Ted Gould <ted@gould.cx>
+
+ Ensure the parent stays ref'd
+
+2011-03-25 Michael Terry <mike@mterry.name>
+
+ fix some potential memory issues in hopes of fixing a reported crash
+
+2011-03-28 Ted Gould <ted@gould.cx>
+
+ Protect our properties parsing a bit more.
+
+2011-03-24 Ted Gould <ted@gould.cx>
+
+ Attaching bug
+
+2011-03-24 Ted Gould <ted@gould.cx>
+
+ Put in some more protections on the types for property variants and generate some errors
+
2011-03-23 Ted Gould <ted@gould.cx>
0.4.0
diff --git a/configure b/configure
index b35e8ab..b3c6de7 100755
--- a/configure
+++ b/configure
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.67 for libdbusmenu 0.4.0.
+# Generated by GNU Autoconf 2.67 for libdbusmenu 0.4.1.
#
# Report bugs to <ted@canonical.com>.
#
@@ -703,8 +703,8 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='libdbusmenu'
PACKAGE_TARNAME='libdbusmenu'
-PACKAGE_VERSION='0.4.0'
-PACKAGE_STRING='libdbusmenu 0.4.0'
+PACKAGE_VERSION='0.4.1'
+PACKAGE_STRING='libdbusmenu 0.4.1'
PACKAGE_BUGREPORT='ted@canonical.com'
PACKAGE_URL=''
@@ -1541,7 +1541,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
-\`configure' configures libdbusmenu 0.4.0 to adapt to many kinds of systems.
+\`configure' configures libdbusmenu 0.4.1 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -1611,7 +1611,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of libdbusmenu 0.4.0:";;
+ short | recursive ) echo "Configuration of libdbusmenu 0.4.1:";;
esac
cat <<\_ACEOF
@@ -1751,7 +1751,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
-libdbusmenu configure 0.4.0
+libdbusmenu configure 0.4.1
generated by GNU Autoconf 2.67
Copyright (C) 2010 Free Software Foundation, Inc.
@@ -2122,7 +2122,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
-It was created by libdbusmenu $as_me 0.4.0, which was
+It was created by libdbusmenu $as_me 0.4.1, which was
generated by GNU Autoconf 2.67. Invocation command line was
$ $0 $@
@@ -2943,7 +2943,7 @@ fi
# Define the identity of the package.
PACKAGE=libdbusmenu
- VERSION=0.4.0
+ VERSION=0.4.1
# Some tools Automake needs.
@@ -13294,7 +13294,7 @@ fi
###########################
LIBDBUSMENU_CURRENT=3
-LIBDBUSMENU_REVISION=11
+LIBDBUSMENU_REVISION=12
LIBDBUSMENU_AGE=0
@@ -14616,7 +14616,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
-This file was extended by libdbusmenu $as_me 0.4.0, which was
+This file was extended by libdbusmenu $as_me 0.4.1, which was
generated by GNU Autoconf 2.67. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@@ -14682,7 +14682,7 @@ _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
-libdbusmenu config.status 0.4.0
+libdbusmenu config.status 0.4.1
configured by $0, generated by GNU Autoconf 2.67,
with options \\"\$ac_cs_config\\"
diff --git a/configure.ac b/configure.ac
index a400680..e94e795 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,11 +1,11 @@
-AC_INIT(libdbusmenu, 0.4.0, ted@canonical.com)
+AC_INIT(libdbusmenu, 0.4.1, ted@canonical.com)
AC_COPYRIGHT([Copyright 2009,2010 Canonical])
AC_PREREQ(2.62)
AM_CONFIG_HEADER(config.h)
-AM_INIT_AUTOMAKE(libdbusmenu, 0.4.0, [-Wno-portability])
+AM_INIT_AUTOMAKE(libdbusmenu, 0.4.1, [-Wno-portability])
AM_MAINTAINER_MODE
@@ -134,7 +134,7 @@ AC_PATH_PROG([XSLT_PROC], [xsltproc])
###########################
LIBDBUSMENU_CURRENT=3
-LIBDBUSMENU_REVISION=11
+LIBDBUSMENU_REVISION=12
LIBDBUSMENU_AGE=0
AC_SUBST(LIBDBUSMENU_CURRENT)
diff --git a/docs/libdbusmenu-glib/reference/html/ch01.html b/docs/libdbusmenu-glib/reference/html/ch01.html
index d054c64..8aa2186 100644
--- a/docs/libdbusmenu-glib/reference/html/ch01.html
+++ b/docs/libdbusmenu-glib/reference/html/ch01.html
@@ -21,7 +21,7 @@
</tr></table>
<div class="chapter">
<div class="titlepage"><div><div><h2 class="title">
-<a name="id440860"></a>API</h2></div></div></div>
+<a name="id471000"></a>API</h2></div></div></div>
<div class="toc"><dl>
<dt>
<span class="refentrytitle"><a href="libdbusmenu-glib-DbusmenuServer.html">DbusmenuServer</a></span><span class="refpurpose"> — The server signals changed and
diff --git a/docs/libdbusmenu-glib/reference/version.xml b/docs/libdbusmenu-glib/reference/version.xml
index 1d0ba9e..267577d 100644
--- a/docs/libdbusmenu-glib/reference/version.xml
+++ b/docs/libdbusmenu-glib/reference/version.xml
@@ -1 +1 @@
-0.4.0
+0.4.1
diff --git a/docs/libdbusmenu-gtk/reference/html/ch01.html b/docs/libdbusmenu-gtk/reference/html/ch01.html
index f8af1ad..67f02ef 100644
--- a/docs/libdbusmenu-gtk/reference/html/ch01.html
+++ b/docs/libdbusmenu-gtk/reference/html/ch01.html
@@ -21,7 +21,7 @@
</tr></table>
<div class="chapter">
<div class="titlepage"><div><div><h2 class="title">
-<a name="id331770"></a>API</h2></div></div></div>
+<a name="id520868"></a>API</h2></div></div></div>
<div class="toc"><dl>
<dt>
<span class="refentrytitle"><a href="libdbusmenu-gtk-DbusmenuGtkMenu.html">DbusmenuGtkMenu</a></span><span class="refpurpose"> — A GTK Menu Object that syncronizes over DBus</span>
diff --git a/docs/libdbusmenu-gtk/reference/version.xml b/docs/libdbusmenu-gtk/reference/version.xml
index 1d0ba9e..267577d 100644
--- a/docs/libdbusmenu-gtk/reference/version.xml
+++ b/docs/libdbusmenu-gtk/reference/version.xml
@@ -1 +1 @@
-0.4.0
+0.4.1
diff --git a/libdbusmenu-glib/client.c b/libdbusmenu-glib/client.c
index 24d5c5d..ef89705 100644
--- a/libdbusmenu-glib/client.c
+++ b/libdbusmenu-glib/client.c
@@ -598,10 +598,10 @@ get_properties_callback (GObject *obj, GAsyncResult * res, gpointer user_data)
}
/* Callback all the folks we can find */
- GVariant * child = g_variant_get_child_value(params, 0);
+ GVariant * parent = g_variant_get_child_value(params, 0);
GVariantIter iter;
- g_variant_iter_init(&iter, child);
- g_variant_unref(child);
+ g_variant_iter_init(&iter, parent);
+ GVariant * child;
while ((child = g_variant_iter_next_value(&iter)) != NULL) {
if (g_strcmp0(g_variant_get_type_string(child), "(ia{sv})") != 0) {
g_warning("Properties return signature is not '(ia{sv})' it is '%s'", g_variant_get_type_string(child));
@@ -632,6 +632,7 @@ get_properties_callback (GObject *obj, GAsyncResult * res, gpointer user_data)
g_variant_unref(properties);
g_variant_unref(child);
}
+ g_variant_unref(parent);
g_variant_unref(params);
/* Provide errors for those who we can't */
@@ -1333,8 +1334,16 @@ menuitem_get_properties_cb (GVariant * properties, GError * error, gpointer data
if (error != NULL) {
g_warning("Error getting properties on a menuitem: %s", error->message);
- g_object_unref(data);
- return;
+ goto out;
+ }
+
+ if (properties == NULL) {
+ goto out;
+ }
+
+ if (!g_variant_is_of_type(properties, G_VARIANT_TYPE("a{sv}"))) {
+ g_warning("Properties are of type '%s' instead of type '%s'", g_variant_get_type_string(properties), "a{sv}");
+ goto out;
}
GVariantIter iter;
@@ -1347,6 +1356,7 @@ menuitem_get_properties_cb (GVariant * properties, GError * error, gpointer data
dbusmenu_menuitem_property_set_variant(item, key, value);
}
+out:
g_object_unref(data);
return;
@@ -1365,12 +1375,16 @@ menuitem_get_properties_replace_cb (GVariant * properties, GError * error, gpoin
g_warning("Unable to replace properties on %d: %s", dbusmenu_menuitem_get_id(DBUSMENU_MENUITEM(data)), error->message);
have_error = TRUE;
}
+
+ if (properties == NULL) {
+ have_error = TRUE;
+ }
/* Get the list of the current properties */
GList * current_props = dbusmenu_menuitem_properties_list(DBUSMENU_MENUITEM(data));
GList * tmp = NULL;
- if (properties != NULL) {
+ if (!have_error && g_variant_is_of_type(properties, G_VARIANT_TYPE("a{sv}"))) {
GVariantIter iter;
g_variant_iter_init(&iter, properties);
gchar * name; GVariant * value;
@@ -1378,7 +1392,7 @@ menuitem_get_properties_replace_cb (GVariant * properties, GError * error, gpoin
/* Remove the entries from the current list that we have new
values for. This way we don't create signals of them being
removed with the duplication of the value being changed. */
- while (g_variant_iter_loop(&iter, "{sv}", &name, &value) && have_error == FALSE) {
+ while (g_variant_iter_loop(&iter, "{sv}", &name, &value)) {
for (tmp = current_props; tmp != NULL; tmp = g_list_next(tmp)) {
if (g_strcmp0((gchar *)tmp->data, name) == 0) {
current_props = g_list_delete_link(current_props, tmp);
@@ -1414,8 +1428,12 @@ menuitem_get_properties_new_cb (GVariant * properties, GError * error, gpointer
if (error != NULL) {
g_warning("Error getting properties on a new menuitem: %s", error->message);
- g_object_unref(propdata->item);
- return;
+ goto out;
+ }
+
+ if (properties == NULL) {
+ g_warning("Not realizing new item as properties for it were unavailable");
+ goto out;
}
DbusmenuClientPrivate * priv = DBUSMENU_CLIENT_GET_PRIVATE(propdata->client);
@@ -1449,6 +1467,7 @@ menuitem_get_properties_new_cb (GVariant * properties, GError * error, gpointer
g_signal_emit(G_OBJECT(propdata->client), signals[NEW_MENUITEM], 0, propdata->item, TRUE);
}
+out:
g_object_unref(propdata->item);
g_free(propdata);
diff --git a/libdbusmenu-glib/defaults.c b/libdbusmenu-glib/defaults.c
index 9eaf9e5..aa479b1 100644
--- a/libdbusmenu-glib/defaults.c
+++ b/libdbusmenu-glib/defaults.c
@@ -81,11 +81,11 @@ dbusmenu_defaults_init (DbusmenuDefaults *self)
/* Standard defaults */
dbusmenu_defaults_default_set(self, DBUSMENU_CLIENT_TYPES_DEFAULT, DBUSMENU_MENUITEM_PROP_VISIBLE, G_VARIANT_TYPE_BOOLEAN, g_variant_new_boolean(TRUE));
dbusmenu_defaults_default_set(self, DBUSMENU_CLIENT_TYPES_DEFAULT, DBUSMENU_MENUITEM_PROP_ENABLED, G_VARIANT_TYPE_BOOLEAN, g_variant_new_boolean(TRUE));
- dbusmenu_defaults_default_set(self, DBUSMENU_CLIENT_TYPES_DEFAULT, DBUSMENU_MENUITEM_PROP_LABEL, G_VARIANT_TYPE_STRING, g_variant_new_string(_("Label Empty")));
+ dbusmenu_defaults_default_set(self, DBUSMENU_CLIENT_TYPES_DEFAULT, DBUSMENU_MENUITEM_PROP_LABEL, G_VARIANT_TYPE_STRING, g_variant_new_string(_("Label Empty")));
dbusmenu_defaults_default_set(self, DBUSMENU_CLIENT_TYPES_DEFAULT, DBUSMENU_MENUITEM_PROP_ICON_NAME, G_VARIANT_TYPE_STRING, NULL);
dbusmenu_defaults_default_set(self, DBUSMENU_CLIENT_TYPES_DEFAULT, DBUSMENU_MENUITEM_PROP_TOGGLE_TYPE, G_VARIANT_TYPE_STRING, NULL);
dbusmenu_defaults_default_set(self, DBUSMENU_CLIENT_TYPES_DEFAULT, DBUSMENU_MENUITEM_PROP_TOGGLE_STATE, G_VARIANT_TYPE_INT32, NULL);
- dbusmenu_defaults_default_set(self, DBUSMENU_CLIENT_TYPES_DEFAULT, DBUSMENU_MENUITEM_PROP_SHORTCUT, G_VARIANT_TYPE_ARRAY, NULL);
+ dbusmenu_defaults_default_set(self, DBUSMENU_CLIENT_TYPES_DEFAULT, DBUSMENU_MENUITEM_PROP_SHORTCUT, G_VARIANT_TYPE("aas"), NULL);
dbusmenu_defaults_default_set(self, DBUSMENU_CLIENT_TYPES_DEFAULT, DBUSMENU_MENUITEM_PROP_CHILD_DISPLAY, G_VARIANT_TYPE_STRING, NULL);
/* Separator defaults */
diff --git a/libdbusmenu-gtk/menuitem.c b/libdbusmenu-gtk/menuitem.c
index ca2bc3e..0f511bc 100644
--- a/libdbusmenu-gtk/menuitem.c
+++ b/libdbusmenu-gtk/menuitem.c
@@ -275,6 +275,17 @@ dbusmenu_menuitem_property_set_shortcut_menuitem (DbusmenuMenuitem * menuitem, c
void
dbusmenu_menuitem_property_get_shortcut (DbusmenuMenuitem * menuitem, guint * key, GdkModifierType * modifier)
{
+ guint dummykey;
+ GdkModifierType dummymodifier;
+
+ if (key == NULL) {
+ key = &dummykey;
+ }
+
+ if (modifier == NULL) {
+ modifier = &dummymodifier;
+ }
+
*key = 0;
*modifier = 0;
@@ -287,15 +298,15 @@ dbusmenu_menuitem_property_get_shortcut (DbusmenuMenuitem * menuitem, guint * ke
if (g_variant_n_children(wrapper) != 1) {
g_warning("Unable to parse shortcut, too many keys");
- g_variant_unref(wrapper);
return;
}
GVariantIter iter;
- g_variant_iter_init(&iter, g_variant_get_child_value(wrapper, 0));
+ GVariant * child = g_variant_get_child_value(wrapper, 0);
+ g_variant_iter_init(&iter, child);
gchar * string;
- while(g_variant_iter_next(&iter, "s", &string)) {
+ while(g_variant_iter_loop(&iter, "s", &string)) {
if (g_strcmp0(string, DBUSMENU_MENUITEM_SHORTCUT_CONTROL) == 0) {
*modifier |= GDK_CONTROL_MASK;
} else if (g_strcmp0(string, DBUSMENU_MENUITEM_SHORTCUT_ALT) == 0) {
@@ -308,10 +319,10 @@ dbusmenu_menuitem_property_get_shortcut (DbusmenuMenuitem * menuitem, guint * ke
GdkModifierType tempmod;
gtk_accelerator_parse(string, key, &tempmod);
}
-
- g_free(string);
}
+ g_variant_unref(child);
+
return;
}
diff --git a/libdbusmenu-gtk/parser.c b/libdbusmenu-gtk/parser.c
index a7f90a2..e68c286 100644
--- a/libdbusmenu-gtk/parser.c
+++ b/libdbusmenu-gtk/parser.c
@@ -454,7 +454,7 @@ construct_dbusmenu_for_widget (GtkWidget * widget)
gboolean visible = FALSE;
gboolean sensitive = FALSE;
- if (GTK_IS_SEPARATOR_MENU_ITEM (widget))
+ if (GTK_IS_SEPARATOR_MENU_ITEM (widget) || !find_menu_label (widget))
{
dbusmenu_menuitem_property_set (mi,
"type",
@@ -512,21 +512,18 @@ construct_dbusmenu_for_widget (GtkWidget * widget)
GtkWidget *label = find_menu_label (widget);
- if (label)
- {
- // Sometimes, an app will directly find and modify the label
- // (like empathy), so watch the label especially for that.
- gchar * text = sanitize_label (GTK_LABEL (label));
- dbusmenu_menuitem_property_set (mi, "label", text);
- g_free (text);
-
- pdata->label = label;
- g_signal_connect (G_OBJECT (label),
- "notify",
- G_CALLBACK (label_notify_cb),
- mi);
- g_object_add_weak_pointer(G_OBJECT (label), (gpointer*)&pdata->label);
- }
+ // Sometimes, an app will directly find and modify the label
+ // (like empathy), so watch the label especially for that.
+ gchar * text = sanitize_label (GTK_LABEL (label));
+ dbusmenu_menuitem_property_set (mi, "label", text);
+ g_free (text);
+
+ pdata->label = label;
+ g_signal_connect (G_OBJECT (label),
+ "notify",
+ G_CALLBACK (label_notify_cb),
+ mi);
+ g_object_add_weak_pointer(G_OBJECT (label), (gpointer*)&pdata->label);
if (GTK_IS_ACTIVATABLE (widget))
{
@@ -760,11 +757,48 @@ find_menu_label (GtkWidget *widget)
}
static void
+recreate_menu_item (DbusmenuMenuitem * parent, DbusmenuMenuitem * child)
+{
+ if (parent == NULL)
+ {
+ /* We need a parent */
+ return;
+ }
+ ParserData * pdata = g_object_get_data (G_OBJECT (child), PARSER_DATA);
+ /* Keep a pointer to the GtkMenuItem, as pdata->widget might be
+ * invalidated when we delete the DbusmenuMenuitem
+ */
+ GtkWidget * menuitem = pdata->widget;
+
+ dbusmenu_menuitem_child_delete (parent, child);
+
+ RecurseContext recurse = {0};
+ recurse.toplevel = gtk_widget_get_toplevel(menuitem);
+ recurse.parent = parent;
+
+ parse_menu_structure_helper(menuitem, &recurse);
+}
+
+static gboolean
+recreate_menu_item_in_idle_cb (gpointer data)
+{
+ DbusmenuMenuitem * child = (DbusmenuMenuitem *)data;
+ DbusmenuMenuitem * parent = dbusmenu_menuitem_get_parent (child);
+ g_object_unref (child);
+ recreate_menu_item (parent, child);
+ return FALSE;
+}
+
+static void
label_notify_cb (GtkWidget *widget,
GParamSpec *pspec,
gpointer data)
{
DbusmenuMenuitem *child = (DbusmenuMenuitem *)data;
+ GValue prop_value = {0};
+
+ g_value_init (&prop_value, pspec->value_type);
+ g_object_get_property (G_OBJECT (widget), pspec->name, &prop_value);
if (pspec->name == g_intern_static_string ("label"))
{
@@ -774,6 +808,24 @@ label_notify_cb (GtkWidget *widget,
text);
g_free (text);
}
+ else if (pspec->name == g_intern_static_string ("parent"))
+ {
+ if (GTK_WIDGET (g_value_get_object (&prop_value)) == NULL)
+ {
+ /* This label is being removed from its GtkMenuItem. The
+ * menuitem becomes a separator now. As the client doesn't handle
+ * changing types so well, we remove the current DbusmenuMenuitem
+ * and add a new one.
+ *
+ * Note, we have to defer this to idle, as we are called before
+ * bin->child member of our old parent is invalidated. If we go ahead
+ * and call parse_menu_structure_helper now, the GtkMenuItem will
+ * still appear to have a label and we never convert it to a separator
+ */
+ g_object_ref (child);
+ g_idle_add ((GSourceFunc)recreate_menu_item_in_idle_cb, child);
+ }
+ }
}
static void
@@ -891,6 +943,20 @@ widget_notify_cb (GtkWidget *widget,
}
else if (pspec->name == g_intern_static_string ("label"))
{
+ ParserData *pdata = g_object_get_data (G_OBJECT (child), PARSER_DATA);
+ if (!pdata->label)
+ {
+ /* GtkMenuItem's can start life as a separator if they have no child
+ * GtkLabel. In this case, we need to convert the DbusmenuMenuitem from
+ * a separator to a normal menuitem if the application adds a label.
+ * As changing types isn't handled too well by the client, we delete
+ * this menuitem for now and then recreate it
+ */
+ DbusmenuMenuitem * parent = dbusmenu_menuitem_get_parent (child);
+ recreate_menu_item (parent, child);
+ return;
+ }
+
dbusmenu_menuitem_property_set (child,
DBUSMENU_MENUITEM_PROP_LABEL,
g_value_get_string (&prop_value));
diff --git a/ltmain.sh b/ltmain.sh
index 6765090..fa4b1e1 100755
--- a/ltmain.sh
+++ b/ltmain.sh
@@ -65,7 +65,7 @@
# compiler: $LTCC
# compiler flags: $LTCFLAGS
# linker: $LD (gnu? $with_gnu_ld)
-# $progname: (GNU libtool) 2.2.6b Debian-2.2.6b-2ubuntu2
+# $progname: (GNU libtool) 2.2.6b Debian-2.2.6b-2ubuntu3
# automake: $automake_version
# autoconf: $autoconf_version
#
@@ -73,7 +73,7 @@
PROGRAM=ltmain.sh
PACKAGE=libtool
-VERSION="2.2.6b Debian-2.2.6b-2ubuntu2"
+VERSION="2.2.6b Debian-2.2.6b-2ubuntu3"
TIMESTAMP=""
package_revision=1.3017