[at-spi2-atk] Only reenter the main loop if AT_SPI_CLIENT is set



commit 34cdfbd948620d091d55b15f92dbfc462c19efd8
Author: Mike Gorse <mgorse novell com>
Date:   Sun Mar 14 08:49:49 2010 -0400

    Only reenter the main loop if AT_SPI_CLIENT is set
    
    If AT_SPI_CLIENT is not set, call dbus_connection_read_write_dispatch instead
    of re-entering the main loop.  Fixes a deadlock with threaded gtk
    applications (ie, gnome-do) where gdk would lock while sending a signal,
    at-spi would re-enter the main loop, and gdk would try to process another
    signal an re-acquire the lock, causing deadlock because the lock is not
    reentrant.

 atk-adaptor/event.c |   14 +++++++++++++-
 1 files changed, 13 insertions(+), 1 deletions(-)
---
diff --git a/atk-adaptor/event.c b/atk-adaptor/event.c
index 34dcda3..69de709 100644
--- a/atk-adaptor/event.c
+++ b/atk-adaptor/event.c
@@ -72,7 +72,19 @@ send_and_allow_reentry (DBusConnection * bus, DBusMessage * message)
   dbus_pending_call_set_notify (pending, set_reply, (void *) &closure, NULL);
   closure.loop = g_main_loop_new (NULL, FALSE);
 
-  g_main_loop_run  (closure.loop);
+  if (getenv ("AT_SPI_CLIENT"))
+    {
+      g_main_loop_run  (closure.loop);
+    }
+  else
+    {
+      closure.reply = NULL;
+      while (!closure.reply)
+        {
+          if (!dbus_connection_read_write_dispatch (spi_global_app_data->bus, 1000))
+            return NULL;
+        }
+    }
   
   g_main_loop_unref (closure.loop);
   return closure.reply;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]