aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTed Gould <ted@canonical.com>2009-05-27 12:40:09 +0200
committerTed Gould <ted@canonical.com>2009-05-27 12:40:09 +0200
commitcad618d081b8526ac1ecde61d3b327febcaad0ab (patch)
tree6d2863fbc393585fbf74070ddb2a01cace8a34c2
parent04612179450b23b7aa31254ab062a4fc144cad6a (diff)
parentd585baaa4ae70e6603e6bacc7d2e4d8acbb914fe (diff)
downloadayatana-indicator-messages-cad618d081b8526ac1ecde61d3b327febcaad0ab.tar.gz
ayatana-indicator-messages-cad618d081b8526ac1ecde61d3b327febcaad0ab.tar.bz2
ayatana-indicator-messages-cad618d081b8526ac1ecde61d3b327febcaad0ab.zip
Fix to start up the service if it isn't running.
-rw-r--r--debian/changelog6
-rw-r--r--src/indicator-messages.c10
2 files changed, 16 insertions, 0 deletions
diff --git a/debian/changelog b/debian/changelog
index 0b1e4d6..68c8558 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,9 @@
+indicator-messages (0.2.0~bzr120~dbusmenu1-0ubuntu2) UNRELEASED; urgency=low
+
+ * Fix to start up the service if it isn't running.
+
+ -- Ted Gould <ted@ubuntu.com> Wed, 27 May 2009 12:39:45 +0200
+
indicator-messages (0.2.0~bzr120~dbusmenu1-0ubuntu1) jaunty; urgency=low
* Merge in the dbusmenu changes from the dbusmenu branch
diff --git a/src/indicator-messages.c b/src/indicator-messages.c
index da80e4b..bccffe7 100644
--- a/src/indicator-messages.c
+++ b/src/indicator-messages.c
@@ -23,6 +23,8 @@ with this program. If not, see <http://www.gnu.org/licenses/>.
#include <string.h>
#include <gtk/gtk.h>
#include <libdbusmenu-gtk/menu.h>
+#include <dbus/dbus-glib.h>
+#include <dbus/dbus-glib-bindings.h>
#include <libindicator/indicator.h>
INDICATOR_SET_VERSION
@@ -57,6 +59,14 @@ get_icon (void)
GtkMenu *
get_menu (void)
{
+ guint returnval = 0;
+ GError * error = NULL;
+
+ DBusGConnection * connection = dbus_g_bus_get(DBUS_BUS_SESSION, NULL);
+ DBusGProxy * proxy = dbus_g_proxy_new_for_name(connection, DBUS_SERVICE_DBUS, DBUS_PATH_DBUS, DBUS_INTERFACE_DBUS);
+
+ org_freedesktop_DBus_start_service_by_name (proxy, INDICATOR_MESSAGES_DBUS_NAME, 0, &returnval, &error);
+
return GTK_MENU(dbusmenu_gtkmenu_new(INDICATOR_MESSAGES_DBUS_NAME, INDICATOR_MESSAGES_DBUS_OBJECT));
}