From b4e81b6ac723fab2e91de6b7a8e106e23ffd4dc6 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Tue, 14 Sep 2010 13:15:02 -0500 Subject: Building up a structure and passing it back on in a callback to clear the bus. --- libdbusmenu-glib/server.c | 37 ++++++++++++++++++++++++++++++++++++- 1 file changed, 36 insertions(+), 1 deletion(-) diff --git a/libdbusmenu-glib/server.c b/libdbusmenu-glib/server.c index 26e7a0d..d7f6de4 100644 --- a/libdbusmenu-glib/server.c +++ b/libdbusmenu-glib/server.c @@ -659,6 +659,33 @@ _dbusmenu_server_get_children (DbusmenuServer * server, gint id, GPtrArray * pro return TRUE; } +/* Structure for holding the event data for the idle function + to pick it up. */ +typedef struct _idle_event_t idle_event_t; +struct _idle_event_t { + DbusmenuMenuitem * mi; + gchar * eventid; + GValue data; + guint timestamp; +}; + +/* A handler for else where in the main loop so that the dbusmenu + event response doesn't get blocked */ +static gboolean +event_local_handler (gpointer user_data) +{ + idle_event_t * data = (idle_event_t *)user_data; + + dbusmenu_menuitem_handle_event(data->mi, data->eventid, &data->data, data->timestamp); + + g_object_unref(data->mi); + g_free(data->eventid); + g_value_unset(&data->data); + g_free(data); + return FALSE; +} + +/* Handles the even coming off of DBus */ static gboolean _dbusmenu_server_event (DbusmenuServer * server, gint id, gchar * eventid, GValue * data, guint timestamp, GError ** error) { @@ -676,7 +703,15 @@ _dbusmenu_server_event (DbusmenuServer * server, gint id, gchar * eventid, GValu return FALSE; } - dbusmenu_menuitem_handle_event(mi, eventid, data, timestamp); + idle_event_t * event_data = g_new0(idle_event_t, 0); + event_data->mi = mi; + g_object_ref(event_data->mi); + event_data->eventid = g_strdup(eventid); + event_data->timestamp = timestamp; + g_value_init(&(event_data->data), G_VALUE_TYPE(data)); + g_value_copy(data, &(event_data->data)); + + g_timeout_add(0, event_local_handler, event_data); return TRUE; } -- cgit v1.2.3 From e06405076da675f90446098160730ff34d268667 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Tue, 14 Sep 2010 13:34:32 -0500 Subject: Turns out you should really allocate things with the allocation function. Who'd have guessed that! --- libdbusmenu-glib/server.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libdbusmenu-glib/server.c b/libdbusmenu-glib/server.c index d7f6de4..d2f4096 100644 --- a/libdbusmenu-glib/server.c +++ b/libdbusmenu-glib/server.c @@ -703,7 +703,7 @@ _dbusmenu_server_event (DbusmenuServer * server, gint id, gchar * eventid, GValu return FALSE; } - idle_event_t * event_data = g_new0(idle_event_t, 0); + idle_event_t * event_data = g_new0(idle_event_t, 1); event_data->mi = mi; g_object_ref(event_data->mi); event_data->eventid = g_strdup(eventid); -- cgit v1.2.3 From 2a02f5bcac6023638644c08e21ee1027a986b513 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Tue, 14 Sep 2010 13:40:59 -0500 Subject: releasing version 0.3.13-0ubuntu1~ppa2~oobsignals1 --- debian/changelog | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index 1f94935..1dad66d 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,10 +1,10 @@ -libdbusmenu (0.3.13-0ubuntu1~ppa2~oobsignals1) UNRELEASED; urgency=low +libdbusmenu (0.3.13-0ubuntu1~ppa2~oobsignals1) maverick; urgency=low * Upstream Merge * Making a callback for the event dbus function happen off of the mainloop so it returns a response. (LP: #636756) - -- Ted Gould Tue, 14 Sep 2010 13:35:06 -0500 + -- Ted Gould Tue, 14 Sep 2010 13:40:55 -0500 libdbusmenu (0.3.13-0ubuntu1~ppa1) maverick; urgency=low -- cgit v1.2.3 From 9fab94f1dac4f9313870e25cadbc36b10443bf2f Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Tue, 14 Sep 2010 16:32:21 -0500 Subject: releasing version 0.3.13-0ubuntu2~ppa1 --- debian/changelog | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index 0ee69cf..e91590f 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,10 +1,10 @@ -libdbusmenu (0.3.13-0ubuntu2~ppa1) UNRELEASED; urgency=low +libdbusmenu (0.3.13-0ubuntu2~ppa1) maverick; urgency=low * Upstream Merge * Making a callback for the event dbus function happen off of the mainloop so it returns a response. (LP: #636756) - -- Ted Gould Tue, 14 Sep 2010 16:25:59 -0500 + -- Ted Gould Tue, 14 Sep 2010 16:32:18 -0500 libdbusmenu (0.3.13-0ubuntu1) maverick; urgency=low -- cgit v1.2.3 From 72164ef8c31d3327f88259eeafecc8eead6dc9e3 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Wed, 15 Sep 2010 09:24:38 -0500 Subject: Unreffing the hashtable. --- libdbusmenu-glib/server.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libdbusmenu-glib/server.c b/libdbusmenu-glib/server.c index d2f4096..68afb92 100644 --- a/libdbusmenu-glib/server.c +++ b/libdbusmenu-glib/server.c @@ -633,6 +633,10 @@ serialize_menuitem(gpointer data, gpointer user_data) _gvalue_array_append_hashtable(item, dict); g_ptr_array_add(output, item); + + g_hash_table_unref(dict); + + return; } static gboolean -- cgit v1.2.3 From 6c3c66e1ccbe10364cb04a7bf1816001bb2fe560 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Wed, 15 Sep 2010 11:28:35 -0500 Subject: 0.3.14 --- configure.ac | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/configure.ac b/configure.ac index 792d065..7e7bf6b 100644 --- a/configure.ac +++ b/configure.ac @@ -1,11 +1,11 @@ -AC_INIT(libdbusmenu, 0.3.13, ted@canonical.com) +AC_INIT(libdbusmenu, 0.3.14, ted@canonical.com) AC_COPYRIGHT([Copyright 2009,2010 Canonical]) AC_PREREQ(2.62) AM_CONFIG_HEADER(config.h) -AM_INIT_AUTOMAKE(libdbusmenu, 0.3.13, [-Wno-portability]) +AM_INIT_AUTOMAKE(libdbusmenu, 0.3.14, [-Wno-portability]) AM_MAINTAINER_MODE @@ -99,7 +99,7 @@ AC_PATH_PROG([VALA_API_GEN], [vapigen]) ########################### LIBDBUSMENU_CURRENT=1 -LIBDBUSMENU_REVISION=15 +LIBDBUSMENU_REVISION=16 LIBDBUSMENU_AGE=0 AC_SUBST(LIBDBUSMENU_CURRENT) -- cgit v1.2.3 From e4fe9d088f9afabcc150361855209cf363b5c12c Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Wed, 15 Sep 2010 11:36:12 -0500 Subject: releasing version 0.3.14-0ubuntu1~ppa1 --- debian/changelog | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index 3507d5d..b240caf 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,11 +1,11 @@ -libdbusmenu (0.3.14-0ubuntu1~ppa1) UNRELEASED; urgency=low +libdbusmenu (0.3.14-0ubuntu1~ppa1) maverick; urgency=low * New upstream release. * Fixing a memory leak by unref'ing a hashtable * Making a callback for the event dbus function happen off of the mainloop so it returns a response. (LP: #636756) - -- Ted Gould Wed, 15 Sep 2010 11:29:32 -0500 + -- Ted Gould Wed, 15 Sep 2010 11:36:09 -0500 libdbusmenu (0.3.13-0ubuntu1) maverick; urgency=low -- cgit v1.2.3