diff options
author | Jamey Sharp <jamey@minilop.net> | 2006-09-12 23:02:42 -0700 |
---|---|---|
committer | Jamey Sharp <jamey@minilop.net> | 2006-09-12 23:02:42 -0700 |
commit | 85a5e98dff9b7752fae157fad9b8c9825cb0efab (patch) | |
tree | 3fcc5882af12ca1c5ba805f19806ab0ab5eee855 | |
parent | a61936fc4e9bd93b108764bbacd5b8f786e51915 (diff) |
Quit using XCBGetQueuedRequestRead.
-rw-r--r-- | src/xcl/xcblock.c | 22 |
1 files changed, 7 insertions, 15 deletions
diff --git a/src/xcl/xcblock.c b/src/xcl/xcblock.c index fad18a0..f46f607 100644 --- a/src/xcl/xcblock.c +++ b/src/xcl/xcblock.c @@ -114,6 +114,9 @@ void _XGetXCBBuffer(Display *dpy) { static const xReq dummy_request; unsigned int xcb_req; + void *reply; + XCBGenericError *error; + PendingRequest *req; XCBConnection *c = dpy->xcl->connection; @@ -128,23 +131,13 @@ void _XGetXCBBuffer(Display *dpy) assert(XCB_SEQUENCE_COMPARE(xcb_req, >=, dpy->request)); dpy->request = xcb_req; - while(dpy->xcl->pending_requests) + while((req = dpy->xcl->pending_requests) + && dpy->request != req->sequence + && XCBPollForReply(c, req->sequence, &reply, &error)) { - XCBGenericRep *reply; - XCBGenericError *error; - PendingRequest *req = dpy->xcl->pending_requests; - /* If this request hasn't been read off the wire yet, save the - * rest for later. */ - if(XCB_SEQUENCE_COMPARE(XCBGetQueuedRequestRead(c), <=, req->sequence)) - break; dpy->xcl->pending_requests = req->next; - /* This can't block due to the above test, but it could "fail" - * by returning null for any of several different reasons. We - * don't care. In any failure cases, we must not have wanted - * an entry in the reply queue for this request after all. */ - reply = XCBWaitForReply(c, req->sequence, &error); if(!reply) - reply = (XCBGenericRep *) error; + reply = error; if(reply) { dpy->last_request_read = req->sequence; @@ -156,7 +149,6 @@ void _XGetXCBBuffer(Display *dpy) if(!dpy->xcl->pending_requests) dpy->xcl->pending_requests_tail = &dpy->xcl->pending_requests; - dpy->last_request_read = XCBGetQueuedRequestRead(c); assert_sequence_less(dpy->last_request_read, dpy->request); } |