[Xfce4-commits] <xfce4-settings:master> Xfsettingsd: Check service name of NameOwnerChanged (bug #9273).
Nick Schermer
noreply at xfce.org
Sun Sep 9 11:52:01 CEST 2012
Updating branch refs/heads/master
to c17fe35e6f2ff673bab102e736a327fa7bcc1d73 (commit)
from e3c6db6f57e72cdbdf0e293bba7d6ca650d7521b (commit)
commit c17fe35e6f2ff673bab102e736a327fa7bcc1d73
Author: Lionel Le Folgoc <lionel at lefolgoc.net>
Date: Sun Sep 9 11:50:19 2012 +0200
Xfsettingsd: Check service name of NameOwnerChanged (bug #9273).
In some conditions, the dbus spawn of xfconf leads to the
shutdown of xfsettingsd because it "thinks" another instance
is taking over... After some debugging I found that it
receives a NameOwnerChanged signal describing the launch
of Xfconf (name=org.xfce.Xfconf, old=, new=:1.11 for example).
xfsettingsd/main.c | 26 ++++++++++++++++++++------
1 files changed, 20 insertions(+), 6 deletions(-)
diff --git a/xfsettingsd/main.c b/xfsettingsd/main.c
index 0f3a68d..55c4183 100644
--- a/xfsettingsd/main.c
+++ b/xfsettingsd/main.c
@@ -93,15 +93,29 @@ signal_handler (gint signum,
static DBusHandlerResult
-dbus_connection_filter_func (DBusConnection *connection,
- DBusMessage *message,
- void *user_data)
+dbus_connection_filter_func (DBusConnection *connection,
+ DBusMessage *message,
+ void *user_data)
{
+ gchar *name, *old, *new;
+
if (dbus_message_is_signal (message, DBUS_INTERFACE_DBUS, "NameOwnerChanged"))
{
- g_printerr (G_LOG_DOMAIN ": %s\n", "Another instance took over. Leaving...");
- gtk_main_quit ();
- return DBUS_HANDLER_RESULT_HANDLED;
+ /* double check if it is really org.xfce.SettingsDaemon
+ * being replaced, see bug 9273 */
+ if (dbus_message_get_args (message, NULL,
+ DBUS_TYPE_STRING, &name,
+ DBUS_TYPE_STRING, &old,
+ DBUS_TYPE_STRING, &new,
+ DBUS_TYPE_INVALID))
+ {
+ if (g_strcmp0 (name, XFSETTINGS_DBUS_NAME) == 0)
+ {
+ g_printerr (G_LOG_DOMAIN ": %s\n", "Another instance took over. Leaving...");
+ gtk_main_quit ();
+ return DBUS_HANDLER_RESULT_HANDLED;
+ }
+ }
}
return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
More information about the Xfce4-commits
mailing list