[at-spi2-core] Add command line option to enable interaction with the gnome session
- From: Mark Doffman <markdoffman src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [at-spi2-core] Add command line option to enable interaction with the gnome session
- Date: Fri, 11 Dec 2009 11:22:28 +0000 (UTC)
commit 3564bdd84f28ee50e0fd42069ca60d033fbd6f1e
Author: Mark Doffman <mark doffman codethink co uk>
Date: Wed Dec 9 22:22:51 2009 -0800
Add command line option to enable interaction with the gnome session
manager.
.../org.freedesktop.atspi.Registry.service.in | 2 +-
registryd/registry-main.c | 25 ++++++++++---------
2 files changed, 14 insertions(+), 13 deletions(-)
---
diff --git a/registryd/org.freedesktop.atspi.Registry.service.in b/registryd/org.freedesktop.atspi.Registry.service.in
index 6ae275d..15ec3e7 100644
--- a/registryd/org.freedesktop.atspi.Registry.service.in
+++ b/registryd/org.freedesktop.atspi.Registry.service.in
@@ -1,3 +1,3 @@
[D-BUS Service]
Name=org.freedesktop.atspi.Registry
-Exec= LIBEXECDIR@/at-spi2-registryd
+Exec= LIBEXECDIR@/at-spi2-registryd --use-gnome-session
diff --git a/registryd/registry-main.c b/registryd/registry-main.c
index c5bcab8..e19c209 100644
--- a/registryd/registry-main.c
+++ b/registryd/registry-main.c
@@ -39,18 +39,20 @@
static GMainLoop *mainloop;
static gchar *dbus_name = NULL;
-
-static DBusGConnection *bus_connection = NULL;
-static DBusGProxy *sm_proxy = NULL;
-static char *client_id = NULL;
-static DBusGProxy *client_proxy = NULL;
+static gboolean use_gnome_session = FALSE;
static GOptionEntry optentries[] =
{
{"dbus-name", 0, 0, G_OPTION_ARG_STRING, &dbus_name, "Well-known name to register with D-Bus", NULL},
+ {"use-gnome-session", 0, 0, G_OPTION_ARG_NONE, &use_gnome_session, "Should register with gnome session manager", NULL},
{NULL}
};
+static DBusGConnection *bus_connection = NULL;
+static DBusGProxy *sm_proxy = NULL;
+static char *client_id = NULL;
+static DBusGProxy *client_proxy = NULL;
+
#define SM_DBUS_NAME "org.gnome.SessionManager"
#define SM_DBUS_PATH "/org/gnome/SessionManager"
#define SM_DBUS_INTERFACE "org.gnome.SessionManager"
@@ -248,7 +250,7 @@ spi_get_bus (void)
if (data == NULL)
{
- g_warning ("AT-SPI: Accessibility bus not found - Using session bus.");
+ g_warning ("AT-SPI: Accessibility bus bus not found - Using session bus.\n");
bus = dbus_bus_get (DBUS_BUS_SESSION, &error);
if (!bus)
g_error ("AT-SPI: Couldn't connect to bus: %s\n", error.message);
@@ -331,14 +333,13 @@ main (int argc, char **argv)
registry = spi_registry_new (bus);
dec = spi_registry_dec_new (registry, bus);
- if (!session_manager_connect ())
+ if (use_gnome_session)
{
- g_warning ("Unable to connect to session manager");
- }
+ if (!session_manager_connect ())
+ g_warning ("Unable to connect to session manager");
- if (!register_client ())
- {
- g_warning ("Unable to register client with session manager");
+ if (!register_client ())
+ g_warning ("Unable to register client with session manager");
}
g_main_loop_run (mainloop);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]