diff options
author | Jamey Sharp <jamey@minilop.net> | 2010-04-14 12:10:34 -0700 |
---|---|---|
committer | Jamey Sharp <jamey@minilop.net> | 2010-04-14 12:54:34 -0700 |
commit | a15c31274650e391bc6de5d0951eb4464c228139 (patch) | |
tree | 15edc82fd2ea2f9304997fc196b649233922f8de | |
parent | 405132dab64bf2375f8e57d02b1b53da2311933a (diff) |
_XError already runs async handlers; only call them directly for replies.
The previous behavior probably would have triggered bug reports someday.
Signed-off-by: Jamey Sharp <jamey@minilop.net>
-rw-r--r-- | src/xcb_io.c | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/src/xcb_io.c b/src/xcb_io.c index 7060976d..f87a0a9a 100644 --- a/src/xcb_io.c +++ b/src/xcb_io.c @@ -138,8 +138,6 @@ static void call_handlers(Display *dpy, xcb_generic_reply_t *buf) if(async->handler(dpy, (xReply *) buf, (char *) buf, sizeof(xReply) + (buf->length << 2), async->data)) return; } - if(buf->response_type == 0) /* unhandled error */ - _XError(dpy, (xError *) buf); } static xcb_generic_event_t * wait_or_poll_for_event(Display *dpy, int wait) @@ -246,20 +244,24 @@ static void process_responses(Display *dpy, int wait_for_first_event, xcb_generi } else if(req && xcb_poll_for_reply(dpy->xcb->connection, req->sequence, &reply, &error)) { - uint64_t sequence = req->sequence; + if(reply || error) + dpy->last_request_read = req->sequence; + if(reply) + { + call_handlers(dpy, reply); + free(reply); + } + if(error) + { + _XError(dpy, (xError *) error); + free(error); + } if(!reply) { dpy->xcb->pending_requests = req->next; if(!dpy->xcb->pending_requests) dpy->xcb->pending_requests_tail = &dpy->xcb->pending_requests; free(req); - reply = error; - } - if(reply) - { - dpy->last_request_read = sequence; - call_handlers(dpy, reply); - free(reply); } } else |