summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2011-09-23 17:31:53 -0400
committerMatthias Clasen <mclasen@redhat.com>2011-09-24 15:43:23 -0400
commit51b5abcea9ee948d11aeb5d6062186f3d4f5ee59 (patch)
tree81be60d688bb855242f6e5590a93423cc5670505
parent90f159c6f14fe8bb932e4d01c46e72ca7b2ffb71 (diff)
downloadat-spi2-atk-51b5abcea9ee948d11aeb5d6062186f3d4f5ee59.tar.gz
Prevent gnome-shell getting stuck on the login screen
The workaround that was committed for this didn't have the intended effect, since the timeout was added to the default main context, not the one that is used in the recursive mainloop. Without this patch, my login screen would freeze when hitting Enter in the password entry, with it, I could successfully log in 10 out of 10 times. https://bugzilla.gnome.org/show_bug.cgi?id=658013
-rw-r--r--atk-adaptor/event.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/atk-adaptor/event.c b/atk-adaptor/event.c
index 79c2884..586d196 100644
--- a/atk-adaptor/event.c
+++ b/atk-adaptor/event.c
@@ -100,6 +100,7 @@ send_and_allow_reentry (DBusConnection * bus, DBusMessage * message)
DBusPendingCall *pending;
SpiReentrantCallClosure closure;
GMainContext *main_context;
+ GSource *source;
main_context = (g_getenv ("AT_SPI_CLIENT") ? NULL :
spi_global_app_data->main_context);
@@ -114,10 +115,13 @@ send_and_allow_reentry (DBusConnection * bus, DBusMessage * message)
return NULL;
}
dbus_pending_call_set_notify (pending, set_reply, (void *) &closure, NULL);
- closure.timeout = g_timeout_add (500, timeout_reply, &closure);
+ source = g_timeout_source_new (500);
+ g_source_set_callback (source, timeout_reply, &closure, NULL);
+ closure.timeout = g_source_attach (source, main_context);
+ g_source_unref (source);
g_main_loop_run (closure.loop);
if (closure.timeout != -1)
- g_source_remove (closure.timeout);
+ g_source_destroy (source);
g_main_loop_unref (closure.loop);
return closure.reply;