[Xcb] Whatever happened to the XCloseDisplay() hooks?

Peter Harris git at peter.is-a-geek.org
Mon Nov 16 18:48:38 PST 2009


On Mon, Oct 19, 2009 at 12:28 AM, Barton C Massey wrote:
> Inconveniences in using XCB are supposed to be papered over
> by building infrastructure atop it, so that we retain the
> strong separation between protocol binding and affordances.
> I guess we haven't figured out the perfect way to do that in
> this case, but I'm pretty sure we can.

Just thinking out loud with the attached. (In particular, I'm not too
happy with the locking quite yet)

Basically, it's an xcb_private (name cribbed from the server concept
of 'privates') in xcb/util that can absorb a callback from a variety
of places (xcb/util/renderutil, soon xcb/util/atom for an atom
prefetch cache, potentially cairo). It means that the application is
responsible for calling xcb_private_free immediately before
xcb_disconnect, but at least the app doesn't have to track all the
various libs (and sub-libs) that may have private per-connection
state.

This tries to avoid a proliferation of
xcb_render_util_disconnect-style library-specific calls that an app
must remember to do. (xcb_render_util_disconnect isn't a real problem
because the info is static and can be regenerated at any time, so a
stray util_disconnect doesn't hurt too much, but I suspect it would
cause problems for the atom prefetch).

Thoughts?

Peter Harris


More information about the Xcb mailing list