[Xcb] [RFC libxcb 0/5] Fix GE events from the ground up, leading to a full 64bit sequence API

Daniel Martin consume.noise at gmail.com
Tue Jun 4 15:52:01 PDT 2013


Hi everyone,

we need to fix GE events to be able to support extensions using such
events properly. Atm. xcb_ge_event_t has the full_sequence field at the
32byte boundary, where it's not supposed to be, because GE events can be
larger then 32byte.

The XInput extension v2++ uses GE events, so it's a show stopper on the
way to have a decent support for it.

One hack would be to inject the full_sequence into GE event structures
while generating the header files. But, that would expose the
full_sequence in specific events, somewhere in the middle of the usual
event data, which is not conform to any specification one can read about
this specific event. Additionally, this injection would need to happen
in c_client.py. Injecting it within xcbgen would force any user of
xcbgen to handle the mistake that happened in libxcb.

So, I came to the conclusion that it's the best to remove it entirely
from xcb_ge_event_t. And as one may want to cast the bare event
structures into each other and I don't like to carry a lot of special
cases (lots of if()s) the full_sequence needs to be removed from all
event structures.
As of the Debian Code Search, there're just a handful of users of the
full_sequence. The only major user and only user relying upon the
full_sequence is libX11. (I've a patched version of it - adopting my
changes - which needs some cleanups, but proved to work.)

A summary of the visible (API) changes:
- Removed the full_sequence from
    xcb_generic_event_t,
    xcb_ge_event_t and
    xcb_generic_error_t.
- Added a function to be able to get the sequence, which has a parameter
  to adjust its behavior (wait, poll or just watch the queue for
  events):
    xcb_rcv_event()
On top of that I additionally changed the remaining "sequences". That
means:
- Made cookies have uint64_t sequences
- Changed all sequence parameters to uint64_t. Most of those functions
  aren't "that" public. They're wrapped in the specific request/reply
  functions. And the change usually was: changing an 'in' parameter from
  unsigned int to uint64_t, which shouldn't be a big deal if you would
  still pass an unsigned int.
With that, libxcb uses uint64_t for sequences from the beginning to the
end. (No widen() is necessary anymore.)


The commit messages may need some polishing. But, for now I would like
get some comments on this. As those changes break API and ABI I'm sure
there'll be some. ;)

Cheers,

Daniel Martin (5):
  Merge xcb_wait_for_event and poll_for_next_event
  Remove full_sequence from all generic structures
  Make get_events aware of full_sequence in queue
  Add xcb_rcv_event with optional out for full_seq
  Complete uint64_t sequence changes

 src/c_client.py |  2 +-
 src/xcb.h       | 32 ++++++++++++++++---
 src/xcb_in.c    | 97 +++++++++++++++++++++++++++++----------------------------
 src/xcb_list.c  |  6 ++--
 src/xcb_out.c   |  6 ++--
 src/xcbext.h    |  6 ++--
 src/xcbint.h    |  4 +--
 7 files changed, 89 insertions(+), 64 deletions(-)

-- 
1.8.3



More information about the Xcb mailing list