summaryrefslogtreecommitdiff
path: root/src/xcb_io.c
diff options
context:
space:
mode:
authorJamey Sharp <jamey@minilop.net>2010-06-21 13:24:24 -0700
committerJamey Sharp <jamey@minilop.net>2010-06-21 13:24:24 -0700
commit301ec5b41e9d253a446db656e1789ac7345dc433 (patch)
tree630727b107d0ea71fc598887f55b291b7fa7221d /src/xcb_io.c
parent4a8b6528ff69f6feb8c0e119939b4ce6c088f29e (diff)
Revert "poll_for_response: Really handle xcb_poll_for_reply getting a reply."
This reverts commit c115095d7f2bc4f5a4fb26380e3698fefdad7611. We *do* need to check poll_for_event every time through the loop in poll_for_response, so the commit did too much.
Diffstat (limited to 'src/xcb_io.c')
-rw-r--r--src/xcb_io.c16
1 files changed, 5 insertions, 11 deletions
diff --git a/src/xcb_io.c b/src/xcb_io.c
index 022f5c49..b246fb9f 100644
--- a/src/xcb_io.c
+++ b/src/xcb_io.c
@@ -232,25 +232,19 @@ 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;
- dequeue_pending_request(dpy, req);
+ if(!response)
+ 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)