Xlib/XCB status and question

Jamey Sharp jamey@minilop.net
Mon, 8 Mar 2004 00:31:58 -0800


--de1H0RjRxOSdb4we
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

I'm still working on porting Xlib to XCB. I committed some fixes
yesterday so that Xlib/XCB compiles again with the current XCB API. I've
also decided to ignore the old X test suite because I can't make it give
sensible answers. More details available on request; if someone wants to
tell me how I'm supposed to be using it or something, that'd be great.

So I'm declaring Xlib/XCB usable, aside from one irritating bug that I
haven't figured out how to track down yet (some apps sometimes hang
until an event is recieved). It'd help a lot if people would try
building freedesktop.org's Xlib with `configure --with-xcb`, and let me
know whether it works for them as a drop-in replacement for normal Xlib.

Meanwhile, I'm trying to figure out how to allow calls to Xlib and XCB
to mix within a single application and a single connection to the X
server. One key difficulty is in synchronizing the view of the event
queue that is presented to calls like XNextEvent and XCBWaitEvent. This
is especially difficult because Xlib-based applications are allowed to
read/modify the event queue without calling any functions in Xlib. (I
believe I heard that Mozilla does this, for instance.) It's also
complicated because Xlib's event queue stores events in a different
format than XCB does, including some information (the 32-bit sequence
number) that can only be reliably generated at the time that the event
arrives. (I'm tempted to make XCB stash that sequence number anyway, but
haven't decided how to get that right yet either.)

I think that any reasonable approach is going to involve hooking into
XCB's event queue access functions, either directing insertion and
removal requests to both libraries' event queues, or forwarding any
requests bound for XCB's list to Xlib's instead. So here's the main
question: is it insane to provide a general API for XCB users to
intercept accesses to the event queue? Since XCB currently interleaves
errors in the event queue as well, this would provide a callback
interface for handling events and errors as they arrive; but since it
also allows for callbacks while finding and removing events from the
queue, it might be a confusingly broad interface.

Looking forward to answers from people experienced at API design...
Thanks.
--=20
Jamey Sharp <jamey@minilop.net> - http://minilop.net/

--de1H0RjRxOSdb4we
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (GNU/Linux)

iD8DBQFATC99NgAXSpyH6VcRAn7WAJ0eOPn2S7Hb6bvTeuM0oi9/HcH0lwCeMskz
Gg9Wmq+6WqNGMA2lnAW25MU=
=6ozp
-----END PGP SIGNATURE-----

--de1H0RjRxOSdb4we--