[Xcb] Experiences with XCB
rand.chars at gmail.com
Tue Sep 19 22:36:12 PDT 2006
As requested by Jamey Sharp, I'm sending in a quick summary of my experiences
with XCB over my SoC project, (the proposal is available at
To start off with, a quick summary of what part of that project _actually_
happened. I got far enough to get a rootless Xnest server running on XCB, but
with truly buggy input (events at the wrong locations, no keysyms, etc).
My experience with XCB was mixed. My first thought was "Where are the docs?!?".
What I found myself doing for documentation was grepping the headers in
include/X11/XCB/* for the sort of things I was looking for, and then trying to
figure out the equivalent Xlib function to look up it's manpage. Ick.
Please, please write man pages with code snippets.
The "strong typing by structs" was another annoyance, although I guess my use
case is nontypical, since I had to interact with the X server's DIX, which uses
scalars. Lots of conversions were going on.
I still believe the biggest deficiency in the XCB API is that there is no way
to peek the next event in the queue. An example use case: I want to collect all
expose events in one function. In my mind, the natural way to do this is
peeking the next event (or at least it's type) to decide if I'm done gathering
exposures. XCB has no way of doing this, as far as I can see, and it makes some
The naming issues for functions.. thank god for the changes! It would be nice
if the type names could be shortened slightly, but you can't have everything ;-)
If there's anything else you'd like to know, feel free to ask.
More information about the Xcb