From: Jonny Lamb Date: Wed, 17 Jun 2009 21:53:10 +0000 (+0100) Subject: Take org.gnome.Empathy as a well-known name on startup. (Fixes #560159) X-Git-Url: https://git.0d.be/?p=empathy.git;a=commitdiff_plain;h=21ed0c9812b89d41518397ff4ee08c3eeebe0712 Take org.gnome.Empathy as a well-known name on startup. (Fixes #560159) Signed-off-by: Jonny Lamb --- diff --git a/src/empathy.c b/src/empathy.c index d5be4df8..f23ce914 100644 --- a/src/empathy.c +++ b/src/empathy.c @@ -38,6 +38,7 @@ #include #include +#include #include #include #include @@ -470,6 +471,7 @@ main (int argc, char *argv[]) gboolean hide_contact_list = FALSE; gboolean accounts_dialog = FALSE; GError *error = NULL; + TpDBusDaemon *dbus_daemon; GOptionEntry options[] = { { "no-connect", 'n', 0, G_OPTION_ARG_NONE, &no_connect, @@ -547,6 +549,23 @@ main (int argc, char *argv[]) g_warning ("Cannot create the 'empathy' bacon connection."); } + /* Take well-known name */ + dbus_daemon = tp_dbus_daemon_dup (&error); + if (error == NULL) { + if (!tp_dbus_daemon_request_name (dbus_daemon, + "org.gnome.Empathy", + TRUE, &error)) { + DEBUG ("Failed to request well-known name: %s", + error ? error->message : "no message"); + g_clear_error (&error); + } + g_object_unref (dbus_daemon); + } else { + DEBUG ("Failed to dup dbus daemon: %s", + error ? error->message : "no message"); + g_clear_error (&error); + } + /* Setting up MC */ mc = empathy_mission_control_dup_singleton (); g_signal_connect (mc, "ServiceEnded",