summaryrefslogtreecommitdiff
path: root/src/xcb_io.c
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2008-10-11 21:44:21 -0700
committerJamey Sharp <jamey@minilop.net>2008-11-04 08:54:01 -0800
commit2dbaaab9c4e3894b33dcae850551dee5473431d5 (patch)
treea0d1deab4c636adcd2f1fdc6ad4c558296c12bb3 /src/xcb_io.c
parentbedfe68259037c5564fe52758c92b9c97729640a (diff)
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>
Diffstat (limited to 'src/xcb_io.c')
-rw-r--r--src/xcb_io.c4
1 files changed, 3 insertions, 1 deletions
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);
}
/*