X-Git-Url: http://git.demorecorder.com/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fxcb_in.c;h=d513cdd331788783d49861d43231fc73bfd84112;hb=bf41af718d6a83532d1c2f63ac16e6484e8e8b68;hp=6433f0e3feed4df30513352d111a88fccc7dd905;hpb=db2504130bc450bd328830060cb3a243dd06b52f;p=free-sw%2Fxcb%2Flibxcb diff --git a/src/xcb_in.c b/src/xcb_in.c index 6433f0e..d513cdd 100644 --- a/src/xcb_in.c +++ b/src/xcb_in.c @@ -363,11 +363,6 @@ int XCBPollForReply(XCBConnection *c, unsigned int request, void **reply, XCBGen return ret; } -XCBGenericEvent *XCBWaitEvent(XCBConnection *c) -{ - return XCBWaitForEvent(c); -} - XCBGenericEvent *XCBWaitForEvent(XCBConnection *c) { XCBGenericEvent *ret; @@ -402,14 +397,21 @@ XCBGenericEvent *XCBPollForEvent(XCBConnection *c, int *error) return ret; } -unsigned int XCBGetRequestRead(XCBConnection *c) +XCBGenericError *XCBRequestCheck(XCBConnection *c, XCBVoidCookie cookie) { - unsigned int ret; - pthread_mutex_lock(&c->iolock); - /* FIXME: follow X meets Z architecture changes. */ - _xcb_in_read(c); - ret = c->in.request_read; - pthread_mutex_unlock(&c->iolock); + /* FIXME: this could hold the lock to avoid syncing unnecessarily, but + * that would require factoring the locking out of XCBGetInputFocus, + * XCBGetInputFocusReply, and XCBWaitForReply. */ + XCBGenericError *ret; + void *reply; + if(XCB_SEQUENCE_COMPARE(cookie.sequence,>,c->in.request_expected) + && XCB_SEQUENCE_COMPARE(cookie.sequence,>,c->in.request_completed)) + { + free(XCBGetInputFocusReply(c, XCBGetInputFocus(c), &ret)); + assert(!ret); + } + reply = XCBWaitForReply(c, cookie.sequence, &ret); + assert(!reply); return ret; }