[Xcb] Feature Request: Function "xcb_test_for_event"

Josh Triplett josh at joshtriplett.org
Mon Apr 8 21:14:16 PDT 2013


On Mon, Apr 08, 2013 at 07:52:19PM -0400, Micah Nordland wrote:
> I believe this is what you are looking for:
> 
> int xcb_get_file_descriptor (xcb_connection_t *c)
>   Access the file descriptor of the connection. ]
> 
> Awesome WM currently uses this with glib, and in the past it used it with
> libev.
> bspwm uses this to do something similar to what you are doing.
> https://github.com/baskerville/bspwm

That does get a file descriptor referring to the X connection, but you
can't use that to wait for X responses without quite a bit of care,
because XCB might have some already read off the wire and stored in
internal buffers; thus, if you block on the X connection having data,
you might wait forever while XCB already has data to give you.

- Josh Triplett


More information about the Xcb mailing list