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 <keithp@keithp.com>
This commit is contained in:
Keith Packard 2008-10-11 21:44:21 -07:00 committed by Jamey Sharp
parent bedfe68259
commit 2dbaaab9c4

View file

@ -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);
}
/*