aboutsummaryrefslogtreecommitdiff
path: root/libX11/src/xcb_io.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2010-06-22 07:34:17 +0000
committermarha <marha@users.sourceforge.net>2010-06-22 07:34:17 +0000
commitfbbbbe88405440920f4baa5a3107ec0b9a6f8cb7 (patch)
tree40b5c424978859de9187ea0073ae9df792cb86b8 /libX11/src/xcb_io.c
parent32eb0b306052c54629bed184cf06b246bb9653cf (diff)
parent5bb359288aac7b23042dc168608f2ced46c851da (diff)
downloadvcxsrv-fbbbbe88405440920f4baa5a3107ec0b9a6f8cb7.tar.gz
vcxsrv-fbbbbe88405440920f4baa5a3107ec0b9a6f8cb7.tar.bz2
vcxsrv-fbbbbe88405440920f4baa5a3107ec0b9a6f8cb7.zip
svn merge ^/branches/released .
Diffstat (limited to 'libX11/src/xcb_io.c')
-rw-r--r--libX11/src/xcb_io.c17
1 files changed, 6 insertions, 11 deletions
diff --git a/libX11/src/xcb_io.c b/libX11/src/xcb_io.c
index d1c5425c6..c2170b4eb 100644
--- a/libX11/src/xcb_io.c
+++ b/libX11/src/xcb_io.c
@@ -235,25 +235,20 @@ static xcb_generic_reply_t *poll_for_response(Display *dpy)
void *response;
xcb_generic_error_t *error;
PendingRequest *req;
-
- response = poll_for_event(dpy);
- if (response)
- return response;
-
- while((req = dpy->xcb->pending_requests) &&
+ while(!(response = poll_for_event(dpy)) &&
+ (req = dpy->xcb->pending_requests) &&
!req->reply_waiter &&
xcb_poll_for_reply(dpy->xcb->connection, req->sequence, &response, &error))
{
assert(XLIB_SEQUENCE_COMPARE(req->sequence, <=, dpy->request));
dpy->last_request_read = req->sequence;
if(response)
- return response;
+ break;
dequeue_pending_request(dpy, req);
if(error)
return (xcb_generic_reply_t *) error;
}
-
- return NULL;
+ return response;
}
static void handle_response(Display *dpy, xcb_generic_reply_t *response, Bool in_XReply)
@@ -365,11 +360,11 @@ void _XReadEvents(Display *dpy)
response = poll_for_response(dpy);
if(response)
handle_response(dpy, response, False);
- else if (dpy->xcb->pending_requests && dpy->xcb->pending_requests->reply_waiter)
+ else if(dpy->xcb->pending_requests->reply_waiter)
{ /* need braces around ConditionWait */
ConditionWait(dpy, dpy->xcb->reply_notify);
}
- else if(xcb_connection_has_error(dpy->xcb->connection))
+ else
_XIOError(dpy);
}