#include "registry.h"
#include "deviceeventcontroller.h"
-#if !defined ATSPI_INTROSPECTION_PATH
- #error "No introspection XML directory defined"
-#endif
-
-#ifdef RELOCATE
-#define DBUS_GCONF_KEY "/desktop/gnome/interface/at-spi-dbus"
-#else
#define CORBA_GCONF_KEY "/desktop/gnome/interface/at-spi-corba"
-#endif
static gboolean need_to_quit ();
}
static void
+kill_accessibility_bus ()
+{
+ FILE *fp;
+ const char *home;
+ char *name;
+ int pid;
+
+ home = getenv ("HOME");
+ if (!home)
+ return;
+ name = g_strconcat (home, "/", ".atspi-dbus-bus.pid", NULL);
+ if (!name)
+ return;
+
+ fp = fopen (name, "r");
+ if (fp)
+ {
+ if (fscanf (fp, "%d", &pid) == 1)
+ {
+ kill (&pid, SIGTERM);
+ }
+ fclose (fp);
+ }
+ g_free (name);
+}
+
+static void
stop_cb (gpointer data)
{
+ kill_accessibility_bus ();
g_main_loop_quit (mainloop);
}
static void
end_session_cb (guint flags, gpointer data)
{
+ kill_accessibility_bus ();
end_session_response (TRUE, NULL);
g_main_loop_quit (mainloop);
}
else
{
bus = dbus_connection_open (data, &error);
+ XFree (data);
if (!bus)
{
g_error ("AT-SPI: Couldn't connect to bus: %s\n", error.message);
}
}
+ XCloseDisplay (bridge_display);
return bus;
}
{
SpiRegistry *registry;
SpiDEController *dec;
- gchar *introspection_directory;
DBusConnection *bus = NULL;
g_print ("SpiRegistry daemon is running with well-known name - %s\n", dbus_name);
}
- /* Get D-Bus introspection directory */
- introspection_directory = (char *) g_getenv("ATSPI_INTROSPECTION_PATH");
- if (introspection_directory == NULL)
- introspection_directory = ATSPI_INTROSPECTION_PATH;
-
registry = spi_registry_new (bus);
dec = spi_registry_dec_new (registry, bus);
gconf_client_get_bool = dlsym (gconf, "gconf_client_get_bool");
}
- if (!gconf_client || !gconf_client_get_bool)
+ if (!gconf_client_get_default || !gconf_client_get_bool)
{
if (gconf)
dlclose (gconf);
* at-spi-dbus gconf key has been set.
*/
gconf_client = gconf_client_get_default ();
-#ifdef RELOCATE
- ret = !gconf_client_get_bool (gconf_client, DBUS_GCONF_KEY, NULL);
-#else
ret = gconf_client_get_bool (gconf_client, CORBA_GCONF_KEY, NULL);
-#endif
g_object_unref (gconf_client);
return ret;