diff options
author | Matthias Clasen <mclasen@redhat.com> | 2007-03-09 05:28:00 +0000 |
---|---|---|
committer | Matthias Clasen <matthiasc@src.gnome.org> | 2007-03-09 05:28:00 +0000 |
commit | 3eb22a1ff80272c6b8df37690262d2907069a9e1 (patch) | |
tree | 36f405e4b8419ed9369f74aad6ac28b8fc4e2234 /gdk/x11 | |
parent | 9aca5027dd52daf3368be86a590a862644710ad5 (diff) | |
download | gdk-pixbuf-3eb22a1ff80272c6b8df37690262d2907069a9e1.tar.gz |
Defer the callbacks to an idle to avoid deadlock with xcb-ified libX11.
2007-03-08 Matthias Clasen <mclasen@redhat.com>
* gdk/x11/gdkasync.c (send_event_handler): Defer the callbacks
to an idle to avoid deadlock with xcb-ified libX11. (#413032,
Sebastian Dröge)
svn path=/trunk/; revision=17436
Diffstat (limited to 'gdk/x11')
-rw-r--r-- | gdk/x11/gdkasync.c | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/gdk/x11/gdkasync.c b/gdk/x11/gdkasync.c index e360bf1a1..633666006 100644 --- a/gdk/x11/gdkasync.c +++ b/gdk/x11/gdkasync.c @@ -112,6 +112,18 @@ struct _SetInputFocusState gulong get_input_focus_req; }; +static gboolean +callback_idle (gpointer data) +{ + SendEventState *state = (SendEventState *)data; + + state->callback (state->window, !state->have_error, state->data); + + g_free (state); + + return FALSE; +} + static Bool send_event_handler (Display *dpy, xReply *rep, @@ -147,12 +159,10 @@ send_event_handler (Display *dpy, } if (state->callback) - state->callback (state->window, !state->have_error, state->data); + gdk_threads_add_idle (callback_idle, state); DeqAsyncHandler(state->dpy, &state->async); - g_free (state); - return (rep->generic.type != X_Error); } |