Deprecated XCBSync, removed from wiki XcbApi, added void XCBAuxSync(c), fixed demos.
XCBSync is a trivial utility function that should be used exceedingly rarely and that has API warts. It's trivial: It simply issues a GetInputFocus request, then waits for and ignores the reply. It should be used rarely because the sync operation forces a round-trip, which is expensive and almost never necessary. Many programs over-use this operation; one possible cause is that the round-trip delay can hide initialization problems, which can make incorrect code appear to work. It has API warts. The caller must pass in an XCBGenericError** (possibly NULL) to be filled in if an X error occurred in response to the GetInputFocus request, but the reference implementation can't produce any error for this request as far as I can tell, and the extra argument is confusing for programmers. XCBSync also returns a boolean indicating whether the sync was successful, which will only be false if an X error occurred (as above, can't happen) or if the connection has failed. But nobody checks this return value anyway, and even if a connection failure error is ignored it will be detected on some later request. That's three strikes: let's get rid of XCBSync. A similar function could go into XCBAux.
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.