Add a gsettings key to specify the location of libatk-bridge.so
[platform/core/uifw/at-spi2-atk.git] / atk-adaptor / bridge.c
index 5b697a0..42ec92c 100644 (file)
@@ -36,6 +36,7 @@
 #include <atk/atk.h>
 
 #include <droute/droute.h>
+#include <gmodule.h>
 
 #include "bridge.h"
 #include "event.h"
@@ -210,6 +211,7 @@ get_registered_event_listeners (SpiBridge *app)
                                          SPI_DBUS_PATH_REGISTRY,
                                          SPI_DBUS_INTERFACE_REGISTRY,
                                          "GetRegisteredEvents");
+  spi_global_app_data->events_initialized = TRUE;
   if (!message)
     return;
 
@@ -318,8 +320,10 @@ register_application (SpiBridge * app)
 /* make sure the directory exists */
 mkdir("/tmp/at-spi2/", S_IRWXU);
 app->app_bus_addr = g_malloc(max_addr_length * sizeof(char));
+#ifndef DISABLE_P2P
 sprintf(app->app_bus_addr, "unix:path=/tmp/at-spi2/socket-%d-%d", getpid(),
 rand());
+#endif
 
   return TRUE;
 }
@@ -515,6 +519,7 @@ new_connection_cb (DBusServer *server, DBusConnection *con, void *data)
 static int
 setup_bus (void)
 {
+#ifndef DISABLE_P2P
   DBusServer *server;
   DBusError err;
 
@@ -529,6 +534,7 @@ setup_bus (void)
   dbus_server_set_new_connection_function(server, new_connection_cb, NULL, NULL);
 
   spi_global_app_data->server = server;
+#endif
 
   return 0;
 }
@@ -715,7 +721,11 @@ adaptor_init (gint * argc, gchar ** argv[])
         }
     }
 
+#ifndef DISABLE_P2P
   spi_global_app_data->main_context = g_main_context_new ();
+#else
+  spi_global_app_data->main_context = NULL;
+#endif
 
   dbus_connection_setup_with_g_main (spi_global_app_data->bus, NULL);
 
@@ -790,8 +800,6 @@ adaptor_init (gint * argc, gchar ** argv[])
 
   setup_bus();
 
-  g_atexit (exit_func);
-
   return 0;
 }
 
@@ -809,6 +817,14 @@ gtk_module_init (gint * argc, gchar ** argv[])
   return 0;
 }
 
+gchar*
+g_module_check_init (GModule *module)
+{
+  g_module_make_resident (module);
+
+  return NULL;
+}
+
 void
 gnome_accessibility_module_init (void)
 {