Bug 7076 - XCBSync does not belong in XCB
Summary: XCBSync does not belong in XCB
Status: RESOLVED FIXED
Alias: None
Product: XCB
Classification: Unclassified
Component: Library (show other bugs)
Version: unspecified
Hardware: All All
: high normal
Assignee: Jamey Sharp
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 6797
  Show dependency treegraph
 
Reported: 2006-05-30 17:07 UTC by Jamey Sharp
Modified: 2006-05-30 11:56 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments

Description Ian Osgood 2006-05-30 11:56:42 UTC
Deprecated XCBSync, removed from wiki XcbApi, added void XCBAuxSync(c), fixed demos.
Comment 1 Jamey Sharp 2006-05-30 17:07:24 UTC
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.