Disable p2p functionality if AT_SPI_CLIENT is set
authorMike Gorse <mgorse@novell.com>
Fri, 1 Oct 2010 14:40:52 +0000 (10:40 -0400)
committerMike Gorse <mgorse@novell.com>
Fri, 1 Oct 2010 14:40:52 +0000 (10:40 -0400)
atk-adaptor/adaptors/application-adaptor.c
atk-adaptor/event.c

index 1877b8f..dd162af 100644 (file)
@@ -96,7 +96,13 @@ impl_get_app_bus(DBusConnection *bus, DBusMessage *msg, void *data)
 DBusMessage *reply;
 
 reply = dbus_message_new_method_return(msg);
-if(reply) dbus_message_append_args(reply, DBUS_TYPE_STRING, &(spi_global_app_data->app_bus_addr), DBUS_TYPE_INVALID);
+if (reply)
+    {
+      const char *retval = (g_getenv ("AT_SPI_CLIENT") ?
+                            "":
+                            spi_global_app_data->app_bus_addr);
+      dbus_message_append_args(reply, DBUS_TYPE_STRING, &retval, DBUS_TYPE_INVALID);
+    }
 
 return reply;
 }
index 28de5ff..4b23c64 100644 (file)
@@ -78,9 +78,12 @@ send_and_allow_reentry (DBusConnection * bus, DBusMessage * message)
 {
   DBusPendingCall *pending;
   SpiReentrantCallClosure closure;
+  GMainContext *main_context;
 
-  closure.loop = g_main_loop_new (spi_global_app_data->main_context, FALSE);
-  switch_main_context (spi_global_app_data->main_context);
+  main_context = (g_getenv ("AT_SPI_CLIENT") ? NULL :
+                  spi_global_app_data->main_context);
+  closure.loop = g_main_loop_new (main_context, FALSE);
+  switch_main_context (main_context);
 
   if (!dbus_connection_send_with_reply (bus, message, &pending, -1))
     {