27ef206
From 95d6e5d7919e7096fc9f77b0a46667f71b09ed5b Mon Sep 17 00:00:00 2001
27ef206
From: Matthias Clasen <mclasen@redhat.com>
27ef206
Date: Fri, 23 Sep 2011 17:31:53 -0400
27ef206
Subject: [PATCH] Prevent gnome-shell getting stuck on the login screen
27ef206
27ef206
The workaround that was committed for this didn't have the
27ef206
intended effect, since the timeout was added to the default
27ef206
main context, not the one that is used in the recursive
27ef206
mainloop.
27ef206
27ef206
Without this patch, my login screen would freeze when hitting
27ef206
Enter in the password entry, with it, I could successfully log
27ef206
in 10 out of 10 times.
27ef206
27ef206
https://bugzilla.gnome.org/show_bug.cgi?id=658013
27ef206
---
27ef206
 atk-adaptor/event.c |    6 +++++-
27ef206
 1 files changed, 5 insertions(+), 1 deletions(-)
27ef206
27ef206
diff --git a/atk-adaptor/event.c b/atk-adaptor/event.c
27ef206
index 79c2884..12e6556 100644
27ef206
--- a/atk-adaptor/event.c
27ef206
+++ b/atk-adaptor/event.c
27ef206
@@ -100,6 +100,7 @@ send_and_allow_reentry (DBusConnection * bus, DBusMessage * message)
27ef206
   DBusPendingCall *pending;
27ef206
   SpiReentrantCallClosure closure;
27ef206
   GMainContext *main_context;
27ef206
+  GSource *source;
27ef206
 
27ef206
   main_context = (g_getenv ("AT_SPI_CLIENT") ? NULL :
27ef206
                   spi_global_app_data->main_context);
27ef206
@@ -114,7 +115,10 @@ send_and_allow_reentry (DBusConnection * bus, DBusMessage * message)
27ef206
       return NULL;
27ef206
     }
27ef206
   dbus_pending_call_set_notify (pending, set_reply, (void *) &closure, NULL);
27ef206
-  closure.timeout = g_timeout_add (500, timeout_reply, &closure);
27ef206
+  source = g_timeout_source_new (500);
27ef206
+  g_source_set_callback (source, timeout_reply, &closure, NULL);
27ef206
+  closure.timeout = g_source_attach (source, main_context);
27ef206
+  g_source_unref (source);
27ef206
   g_main_loop_run  (closure.loop);
27ef206
   if (closure.timeout != -1)
27ef206
     g_source_remove (closure.timeout);
27ef206
-- 
27ef206
1.7.6.2
27ef206