[Xcb] Introduce new API-function xcb_consume_data

Thomas Hunger hto at arcor.de
Tue Aug 7 03:45:09 PDT 2007


Hello,

when I use poll/select to wait for new events I use 

  ev = xcb_poll_for_event(c);

to retrieve new events.

Now it is possible that there is no new event in the queue 
(ev == NULL) but still data that can be read, causing my select to 
wake up all the time.

_xcb_conn_wait calls _xcb_in_read which reads as much data as possible 
so that the next select doesn't wake up immediatly.
I would like to introduce a new API-call 

  xcb_consume_data(c);

which reads until select would block again.

I could run xcb in an extra thread and use wait_for_event, but I have 
some reasons why I don't want to do that right now (maybe later).

What do you think?

Tom


More information about the Xcb mailing list