if (message)
dbus_message_unref (message);
+/* could this be better, we accept some amount of race in getting the temp name*/
+/* make sure the directory exists */
+mkdir("/tmp/at-spi2/", 0);
+app->app_bus_addr = mktmp("/tmp/at-spi2/app-socket-xxxxxx");
+ }
+ else
+ {
+ g_warning ("AT-SPI: Could not embed inside desktop: %s\n", error.message);
+ return FALSE;
+ }
return TRUE;
}
socket_class->embed = socket_embed_hook;
}
+static void new_connection_cb(DBusServer *server, DBusConnection *con, void *data)
+{
+dbus_connection_ref(con);
+dbus_connection_setup_with_g_main(con, NULL);
+}
+
+static int setup_bus(void)
+{
+DBusServer *server;
+DBusError err;
+
+dbus_error_init(&err);
+ server = dbus_server_listen(spi_global_app_data->app_bus_addr, &err);
+
+/* is there a better way to handle this */
+if(server == NULL) return -1;
+
+dbus_server_setup_with_g_main(server, NULL);
+dbus_server_set_new_connection_function(server, new_connection_cb, NULL, NULL);
+
+return 0;
+}
+
+
gchar *atspi_dbus_name = NULL;
static gboolean atspi_no_register = FALSE;
*
* - DRoute for routing message to their accessible objects.
* - Event handlers for emmitting signals on specific ATK events.
+ * - setup the bus for p2p communication
* - Application registration with the AT-SPI registry.
*
*/
else
get_registered_event_listeners (spi_global_app_data);
+ setup_bus();
+
g_atexit (exit_func);
return 0;