From 746a792ef912c5160fed15bf817df5124f6610b0 Mon Sep 17 00:00:00 2001 From: Oleg Shparber Date: Mon, 21 Mar 2011 09:00:36 -0500 Subject: Entering and exiting the GDK threads when calling up to GTK --- libdbusmenu-gtk/parser.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libdbusmenu-gtk/parser.c b/libdbusmenu-gtk/parser.c index 9d93a1e..a7f90a2 100644 --- a/libdbusmenu-gtk/parser.c +++ b/libdbusmenu-gtk/parser.c @@ -845,7 +845,9 @@ item_activated (DbusmenuMenuitem *item, guint timestamp, gpointer user_data) if (GTK_IS_MENU_ITEM (child)) { + gdk_threads_enter (); gtk_menu_item_activate (GTK_MENU_ITEM (child)); + gdk_threads_leave (); } } } -- cgit v1.2.3 From 7a250968365a7d840ea30f48f9cc8dc016f1481e Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Mon, 21 Mar 2011 09:09:02 -0500 Subject: releasing version 0.3.102-0ubuntu2~ppa1 --- debian/changelog | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index e8d9d7d..191f077 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,9 +1,9 @@ -libdbusmenu (0.3.102-0ubuntu2~ppa1) UNRELEASED; urgency=low +libdbusmenu (0.3.102-0ubuntu2~ppa1) natty; urgency=low * Upstream Merge * Enter and exit the GDK threads before calling GTK (LP: #717162) - -- Ted Gould Mon, 21 Mar 2011 09:02:41 -0500 + -- Ted Gould Mon, 21 Mar 2011 09:08:59 -0500 libdbusmenu (0.3.102-0ubuntu1) natty; urgency=low -- cgit v1.2.3 From 6249256f1d55968f054e0dcbac01591c0fa01da1 Mon Sep 17 00:00:00 2001 From: Michael Terry Date: Mon, 21 Mar 2011 12:06:57 -0400 Subject: check menu items for accelerators directly if accel label doesn't have one --- libdbusmenu-gtk/menuitem.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/libdbusmenu-gtk/menuitem.c b/libdbusmenu-gtk/menuitem.c index b3358fe..ca2bc3e 100644 --- a/libdbusmenu-gtk/menuitem.c +++ b/libdbusmenu-gtk/menuitem.c @@ -236,8 +236,15 @@ dbusmenu_menuitem_property_set_shortcut_menuitem (DbusmenuMenuitem * menuitem, c NULL); } - if (closure == NULL) - return FALSE; + if (closure == NULL) { + /* As a fallback, check for a closure in the related menu item. This + actually happens with SWT menu items. */ + GList * closures = gtk_widget_list_accel_closures (GTK_WIDGET (gmi)); + if (closures == NULL) + return FALSE; + closure = closures->data; + g_list_free (closures); + } GtkAccelGroup * group = gtk_accel_group_from_accel_closure(closure); -- cgit v1.2.3 From ef9ec99c8deea6464debc0f46db35a943143ba79 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Mon, 21 Mar 2011 11:46:34 -0500 Subject: Use iter_loop to handle unref'ing the variants cleanly. --- libdbusmenu-glib/client.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/libdbusmenu-glib/client.c b/libdbusmenu-glib/client.c index 2976436..5aae810 100644 --- a/libdbusmenu-glib/client.c +++ b/libdbusmenu-glib/client.c @@ -1336,19 +1336,16 @@ menuitem_get_properties_cb (GVariant * properties, GError * error, gpointer data return; } - GVariantIter * iter = g_variant_iter_new(properties); + GVariantIter iter; gchar * key; GVariant * value; - while (g_variant_iter_next(iter, "{sv}", &key, &value)) { - dbusmenu_menuitem_property_set_variant(item, key, value); + g_variant_iter_init(&iter, properties); - g_variant_unref(value); - g_free(key); + while (g_variant_iter_loop(&iter, "{sv}", &key, &value)) { + dbusmenu_menuitem_property_set_variant(item, key, value); } - g_variant_iter_free(iter); - g_object_unref(data); return; -- cgit v1.2.3 From 9f73955ad07742884819edb0da91d6f71e5bb310 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Mon, 21 Mar 2011 11:47:50 -0500 Subject: Removing an unneeded iner_new --- libdbusmenu-glib/client.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libdbusmenu-glib/client.c b/libdbusmenu-glib/client.c index 5aae810..77154fb 100644 --- a/libdbusmenu-glib/client.c +++ b/libdbusmenu-glib/client.c @@ -599,9 +599,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); - GVariantIter * iter = g_variant_iter_new(child); + GVariantIter iter; + g_variant_iter_init(&iter, child); g_variant_unref(child); - while ((child = g_variant_iter_next_value(iter)) != NULL) { + 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)); g_variant_unref(child); @@ -631,7 +632,6 @@ get_properties_callback (GObject *obj, GAsyncResult * res, gpointer user_data) g_variant_unref(properties); g_variant_unref(child); } - g_variant_iter_free(iter); g_variant_unref(params); /* Provide errors for those who we can't */ -- cgit v1.2.3 From b0889bb2cb63e1dd08b87e3c45a1e12fb237a6c2 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Mon, 21 Mar 2011 11:54:49 -0500 Subject: Moving from iter_next to iter_loop on a couple more iterators --- libdbusmenu-glib/client.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/libdbusmenu-glib/client.c b/libdbusmenu-glib/client.c index 77154fb..ff74bbf 100644 --- a/libdbusmenu-glib/client.c +++ b/libdbusmenu-glib/client.c @@ -1153,7 +1153,7 @@ menuproxy_prop_changed_cb (GDBusProxy * proxy, GVariant * properties, GStrv inva GVariantIter iters; gchar * key; GVariant * value; g_variant_iter_init(&iters, properties); - while (g_variant_iter_next(&iters, "{sv}", &key, &value)) { + while (g_variant_iter_loop(&iters, "{sv}", &key, &value)) { if (g_strcmp0(key, "TextDirection") == 0) { if (g_variant_is_of_type(value, G_VARIANT_TYPE_VARIANT)) { GVariant * tmp = g_variant_get_variant(value); @@ -1181,9 +1181,6 @@ menuproxy_prop_changed_cb (GDBusProxy * proxy, GVariant * properties, GStrv inva priv->icon_dirs = g_variant_dup_strv(value, NULL); dirs_changed = TRUE; } - - g_variant_unref(value); - g_free(key); } if (olddir != priv->text_direction) { @@ -1258,10 +1255,9 @@ menuproxy_signal_cb (GDBusProxy * proxy, gchar * sender, gchar * signal, GVarian g_variant_iter_init(&properties, propv); gchar * property; - while (g_variant_iter_next(&properties, "s", &property)) { + while (g_variant_iter_loop(&properties, "s", &property)) { /* g_debug("Removing property '%s' on %d", property, id); */ dbusmenu_menuitem_property_remove(menuitem, property); - g_free(property); } g_variant_unref(ritem); g_variant_unref(propv); -- cgit v1.2.3 From f297caeae1f563fe023cfd57cd7b3d05d8d32d47 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Mon, 21 Mar 2011 11:57:17 -0500 Subject: A couple more intr_loops with a small memory leak fix --- libdbusmenu-glib/client.c | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/libdbusmenu-glib/client.c b/libdbusmenu-glib/client.c index ff74bbf..20b91f1 100644 --- a/libdbusmenu-glib/client.c +++ b/libdbusmenu-glib/client.c @@ -1280,15 +1280,20 @@ menuproxy_signal_cb (GDBusProxy * proxy, gchar * sender, gchar * signal, GVarian gchar * property; GVariant * value; - while (g_variant_iter_next(&properties, "{sv}", &property, &value)) { + while (g_variant_iter_loop(&properties, "{sv}", &property, &value)) { GVariant * internalvalue = value; if (G_LIKELY(g_variant_is_of_type(value, G_VARIANT_TYPE_VARIANT))) { /* Unboxing if needed */ internalvalue = g_variant_get_variant(value); - g_variant_unref(value); } + id_prop_update(proxy, id, property, internalvalue, client); - g_variant_unref(internalvalue); + + if (internalvalue != value) { + /* If we unboxed, we need to drop it, otherwise the + iter_loop function will unref for us */ + g_variant_unref(internalvalue); + } } g_variant_unref(propv); g_variant_unref(item); @@ -1707,20 +1712,16 @@ parse_layout_xml(DbusmenuClient * client, GVariant * layout, DbusmenuMenuitem * all other properties. */ child_props = g_variant_get_child_value(child, 1); g_variant_iter_init(&iter, child_props); - while (g_variant_iter_next(&iter, "{sv}", &prop, &value)) { + while (g_variant_iter_loop(&iter, "{sv}", &prop, &value)) { if (g_strcmp0(prop, DBUSMENU_MENUITEM_PROP_TYPE) == 0) { dbusmenu_menuitem_property_set_variant(childmi, prop, value); } - g_free(prop); - g_variant_unref(value); } /* Now go through and do all the properties. */ g_variant_iter_init(&iter, child_props); - while (g_variant_iter_next(&iter, "{sv}", &prop, &value)) { + while (g_variant_iter_loop(&iter, "{sv}", &prop, &value)) { dbusmenu_menuitem_property_set_variant(childmi, prop, value); - g_free(prop); - g_variant_unref(value); } g_variant_unref(child_props); } -- cgit v1.2.3 From 8bab6b9d433d5cfd0d03c303e9d3e6bdc14a035d Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Tue, 22 Mar 2011 14:55:33 -0500 Subject: Protect the entries that are about to be updated from being removed --- libdbusmenu-glib/client.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/libdbusmenu-glib/client.c b/libdbusmenu-glib/client.c index 2976436..018508c 100644 --- a/libdbusmenu-glib/client.c +++ b/libdbusmenu-glib/client.c @@ -1368,9 +1368,28 @@ menuitem_get_properties_replace_cb (GVariant * properties, GError * error, gpoin have_error = TRUE; } + /* Get the list of the current properties */ GList * current_props = dbusmenu_menuitem_properties_list(DBUSMENU_MENUITEM(data)); GList * tmp = NULL; + GVariantIter iter; + g_variant_iter_init(&iter, properties); + gchar * name; GVariant * value; + + /* 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) { + for (tmp = current_props; tmp != NULL; tmp = g_list_next(tmp)) { + if (g_strcmp0((gchar *)tmp->data, name) == 0) { + current_props = g_list_remove(current_props, tmp); + break; + } + } + } + + /* Remove all entries that we're not getting values for, we can + assume that they no longer exist */ for (tmp = current_props; tmp != NULL && have_error == FALSE; tmp = g_list_next(tmp)) { dbusmenu_menuitem_property_remove(DBUSMENU_MENUITEM(data), (const gchar *)tmp->data); } -- cgit v1.2.3 From 2eda7d871f7ece27a8c824e16616989d16203b5e Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Tue, 22 Mar 2011 15:05:10 -0500 Subject: releasing version 0.3.102-0ubuntu2~ppa2 --- debian/changelog | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index d8e254f..819f65a 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,10 +1,10 @@ -libdbusmenu (0.3.102-0ubuntu2~ppa2) UNRELEASED; urgency=low +libdbusmenu (0.3.102-0ubuntu2~ppa2) natty; urgency=low * Upstream Merge * Protecting properties that are getting updated from an extra remove signal. (LP: #730925) - -- Ted Gould Tue, 22 Mar 2011 14:56:01 -0500 + -- Ted Gould Tue, 22 Mar 2011 15:05:05 -0500 libdbusmenu (0.3.102-0ubuntu2~ppa1) natty; urgency=low -- cgit v1.2.3 From a7c1e6c502cdc834617c59d157a3b787a5e8b0c7 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Tue, 22 Mar 2011 15:23:46 -0500 Subject: Remove the link instead of the data --- libdbusmenu-glib/client.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libdbusmenu-glib/client.c b/libdbusmenu-glib/client.c index 018508c..825f3cb 100644 --- a/libdbusmenu-glib/client.c +++ b/libdbusmenu-glib/client.c @@ -1382,7 +1382,7 @@ menuitem_get_properties_replace_cb (GVariant * properties, GError * error, gpoin while (g_variant_iter_loop(&iter, "{sv}", &name, &value) && have_error == FALSE) { for (tmp = current_props; tmp != NULL; tmp = g_list_next(tmp)) { if (g_strcmp0((gchar *)tmp->data, name) == 0) { - current_props = g_list_remove(current_props, tmp); + current_props = g_list_delete_link(current_props, tmp); break; } } -- cgit v1.2.3 From f3616aa2137f519baf175649fafd2f83ae169830 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Tue, 22 Mar 2011 16:22:22 -0500 Subject: Protect against NULL properties --- libdbusmenu-glib/client.c | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/libdbusmenu-glib/client.c b/libdbusmenu-glib/client.c index 825f3cb..fbf7621 100644 --- a/libdbusmenu-glib/client.c +++ b/libdbusmenu-glib/client.c @@ -1372,18 +1372,20 @@ menuitem_get_properties_replace_cb (GVariant * properties, GError * error, gpoin GList * current_props = dbusmenu_menuitem_properties_list(DBUSMENU_MENUITEM(data)); GList * tmp = NULL; - GVariantIter iter; - g_variant_iter_init(&iter, properties); - gchar * name; GVariant * value; - - /* 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) { - 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); - break; + if (properties != NULL) { + GVariantIter iter; + g_variant_iter_init(&iter, properties); + gchar * name; GVariant * value; + + /* 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) { + 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); + break; + } } } } -- cgit v1.2.3 From 1b43bb9660c247722dd306a46cea2924c29c3b6c Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Wed, 23 Mar 2011 12:05:57 -0500 Subject: releasing version 0.3.102-0ubuntu2~ppa3 --- debian/changelog | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index f10ae0f..c9019de 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,10 +1,10 @@ -libdbusmenu (0.3.102-0ubuntu2~ppa3) UNRELEASED; urgency=low +libdbusmenu (0.3.102-0ubuntu2~ppa3) natty; urgency=low * Upstream Merge * Protect from NULL variants by using iter_loop (LP: #737844) * Look for accellerators inside the labels as well - -- Ted Gould Wed, 23 Mar 2011 11:42:42 -0500 + -- Ted Gould Wed, 23 Mar 2011 12:05:54 -0500 libdbusmenu (0.3.102-0ubuntu2~ppa2) natty; urgency=low -- cgit v1.2.3 From e7acae9db34e6abea6b7aa1fe532ad18e13577c7 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Wed, 23 Mar 2011 14:21:09 -0500 Subject: 0.4.0 --- configure.ac | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/configure.ac b/configure.ac index 84e0bec..a400680 100644 --- a/configure.ac +++ b/configure.ac @@ -1,11 +1,11 @@ -AC_INIT(libdbusmenu, 0.3.102, ted@canonical.com) +AC_INIT(libdbusmenu, 0.4.0, ted@canonical.com) AC_COPYRIGHT([Copyright 2009,2010 Canonical]) AC_PREREQ(2.62) AM_CONFIG_HEADER(config.h) -AM_INIT_AUTOMAKE(libdbusmenu, 0.3.102, [-Wno-portability]) +AM_INIT_AUTOMAKE(libdbusmenu, 0.4.0, [-Wno-portability]) AM_MAINTAINER_MODE @@ -134,7 +134,7 @@ AC_PATH_PROG([XSLT_PROC], [xsltproc]) ########################### LIBDBUSMENU_CURRENT=3 -LIBDBUSMENU_REVISION=10 +LIBDBUSMENU_REVISION=11 LIBDBUSMENU_AGE=0 AC_SUBST(LIBDBUSMENU_CURRENT) -- cgit v1.2.3 From fe1b40cc146c28681b6473ab28198def62c5a38d Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Wed, 23 Mar 2011 14:56:27 -0500 Subject: releasing version 0.4.0-0ubuntu1~ppa1 --- debian/changelog | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index 5ed0304..7c87bc0 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -libdbusmenu (0.4.0-0ubuntu1~ppa1) UNRELEASED; urgency=low +libdbusmenu (0.4.0-0ubuntu1~ppa1) natty; urgency=low * New upstream release. * Protect from NULL variants by using iter_loop (LP: #737844) @@ -7,7 +7,7 @@ libdbusmenu (0.4.0-0ubuntu1~ppa1) UNRELEASED; urgency=low extra remove signal. (LP: #730925) * Enter and exit the GDK threads before calling GTK (LP: #717162) - -- Ted Gould Wed, 23 Mar 2011 14:47:22 -0500 + -- Ted Gould Wed, 23 Mar 2011 14:56:24 -0500 libdbusmenu (0.3.102-0ubuntu1) natty; urgency=low -- cgit v1.2.3