[Xcb] problem with xcb_poll_for_reply (or xcb_wait_for_reply)

Julien Danjou julien at danjou.info
Thu Aug 14 05:17:18 PDT 2008

At 1218051831 time_t, Julien Danjou wrote:
> Maybe exporting a dumb file descriptor which can be selected to *know*
> they're events in the XCB queue would be better (something like
> timerfd?).

Well, finally I took one hour this morning to implement this idea.

I had no clue on how to get this done right. I was think about using the
eventfd interface, but since it's Linux-only, I dropped the idea.
I also was thinking about a giraffe, but I dropped the idea too.

Finally, I found that pipe(7) was the best choice. YMMV.

This patch has been tested with awesome. For those who doubt about it,
it perfectly works as expected, and kill the problem me and Vincent were
talking about. The (almost) only change needed for me was to poll() and
the event fd rather then the old xfd so changing:

-    xfd = xcb_get_file_descriptor(globalconf.connection);
+    xfd = xcb_get_event_file_descriptor(globalconf.connection);

And continue to poll() on this so-called xfd.

I'd like to hear comments, critics, etc, etc before I blindly pushed it
on master with you yelling at me. :-)

Julien Danjou
// ᐰ <julien at danjou.info>   http://julien.danjou.info
// 9A0D 5FD9 EB42 22F6 8974  C95C A462 B51E C2FE E5CD
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: Digital signature
Url : http://lists.freedesktop.org/archives/xcb/attachments/20080814/571483a0/attachment.pgp 

More information about the Xcb mailing list