From 9b01e7849775749182052fe324df9d8e6ceeee99 Mon Sep 17 00:00:00 2001 From: Jamey Sharp Date: Tue, 21 Feb 2006 12:51:44 -0800 Subject: [PATCH] Factor the XCBSendRequest call out of the conditional in _XPutXCBBuffer. --- src/xcl/xcblock.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/xcl/xcblock.c b/src/xcl/xcblock.c index 8413da29..42fee686 100644 --- a/src/xcl/xcblock.c +++ b/src/xcl/xcblock.c @@ -161,6 +161,7 @@ void _XPutXCBBuffer(Display *dpy) while(bufptr < dpy->bufptr) { struct iovec iov[2]; + unsigned int sequence; int i; CARD32 len = ((CARD16 *) bufptr)[1]; if(len == 0) @@ -189,6 +190,8 @@ void _XPutXCBBuffer(Display *dpy) for(i = 0; i < xcb_req.count; ++i) _XBeforeFlush(dpy, &iov[i]); + XCBSendRequest(c, &sequence, iov, &xcb_req); + /* For requests we issue, we need to get back replies and * errors. That's true even if we don't own the event queue, and * also if there are async handlers registered. If we do own the @@ -201,15 +204,10 @@ void _XPutXCBBuffer(Display *dpy) PendingRequest *req = malloc(sizeof(PendingRequest)); assert(req); req->next = 0; - XCBSendRequest(c, &req->sequence, iov, &xcb_req); + req->sequence = sequence; *dpy->xcl->pending_requests_tail = req; dpy->xcl->pending_requests_tail = &req->next; } - else - { - unsigned int dummy; - XCBSendRequest(c, &dummy, iov, &xcb_req); - } } assert(XCBGetRequestSent(c) == dpy->request); dpy->bufptr = dpy->buffer;