summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJamey Sharp <jamey@minilop.net>2008-09-18 16:47:27 -0700
committerKeith Packard <keithp@keithp.com>2009-03-10 14:27:23 -0700
commit41131881b2a391e45adeb3f277de7b8d6a67cc16 (patch)
tree8e0584c50b635d16077cda5f2a95715cb3f32214
parent1819224ff28a9f2c5d5229a3a841e439a84cc34f (diff)
Receive selected replies in event queue.handoff
Commit by Josh Triplett and Jamey Sharp.
-rw-r--r--src/xcb_in.c5
-rw-r--r--src/xcbext.h3
2 files changed, 5 insertions, 3 deletions
diff --git a/src/xcb_in.c b/src/xcb_in.c
index 212dc9a..36ec26b 100644
--- a/src/xcb_in.c
+++ b/src/xcb_in.c
@@ -188,8 +188,9 @@ static int read_packet(xcb_connection_t *c)
((xcb_generic_event_t *) buf)->full_sequence = c->in.request_read;
/* reply, or checked error */
- if( genrep.response_type == XCB_REPLY ||
- (genrep.response_type == XCB_ERROR && pend && (pend->flags & XCB_REQUEST_CHECKED)))
+ if(!(pend && (pend->flags & XCB_REQUEST_QUEUE_RESPONSE)) &&
+ ((pend && (pend->flags & XCB_REQUEST_CHECKED) && genrep.response_type == XCB_ERROR) ||
+ genrep.response_type == XCB_REPLY))
{
reader_list *reader;
struct reply_list *cur = malloc(sizeof(struct reply_list));
diff --git a/src/xcbext.h b/src/xcbext.h
index 2e10ba2..bd26039 100644
--- a/src/xcbext.h
+++ b/src/xcbext.h
@@ -54,7 +54,8 @@ typedef struct {
enum xcb_send_request_flags_t {
XCB_REQUEST_CHECKED = 1 << 0,
XCB_REQUEST_RAW = 1 << 1,
- XCB_REQUEST_DISCARD_REPLY = 1 << 2
+ XCB_REQUEST_DISCARD_REPLY = 1 << 2,
+ XCB_REQUEST_QUEUE_RESPONSE = 1 << 3 /* Put the response in the event queue */
};
unsigned int xcb_send_request(xcb_connection_t *c, int flags, struct iovec *vector, const xcb_protocol_request_t *request);