From 2dbaaab9c4e3894b33dcae850551dee5473431d5 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Sat, 11 Oct 2008 21:44:21 -0700 Subject: Ensure that _XReadEvents always leaves an event in the queue on return XNextEvent assumes that the event queue will be non-empty on return from _XReadEvents, but with multiple event readers running, the previous change could leave the queue empty on return from process_responses. Re-invoke process_responses until the queue is non-empty. Signed-off-by: Keith Packard --- src/xcb_io.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/xcb_io.c') diff --git a/src/xcb_io.c b/src/xcb_io.c index de5525bc..1fa62ec5 100644 --- a/src/xcb_io.c +++ b/src/xcb_io.c @@ -267,7 +267,9 @@ void _XReadEvents(Display *dpy) if(dpy->xcb->event_owner != XlibOwnsEventQueue) return; check_internal_connections(dpy); - process_responses(dpy, 1, 0, 0); + do { + process_responses(dpy, 1, 0, 0); + } while (dpy->qlen == 0); } /* -- cgit v1.2.3