[Xcb] Whatever happened to the XCloseDisplay() hooks?
Barton C Massey
bart at cs.pdx.edu
Wed Oct 14 11:52:32 PDT 2009
I understand where you're coming from, and appreciate the
patch you sent. I'm afraid, however, that we shouldn't do
callbacks in XCB core, since it's just a protocol
One alternative that seems reasonable to me is for you to
wrap xcb_disconnect() yourself, and ask Cairo apps to call
your wrapper for connections that have been used by Cairo.
In principle this could create problems for libraries, but
in practice I can't think of any interesting use case for
calling xcb_disconnect() from a library offhand.
Another good question is whether we should require calling
xcb_disconnect() at all after xcb_render_util_disconnect()
has been called, or whether the latter should just call
xcb_disconnect() itself. Hopefully Jamey can weigh in on
this one. At any rate, if you're going to hook something in
XCB space, I'd be OK with hooking
xcb_render_util_disconnect() rather than xcb_disconnect().
In message <1255536885-3669-1-git-send-email-chris at chris-wilson.co.uk> you wrote:
> In cairo we maintain various per-screen caches that we need to reap when
> the connection is closed, otherwise we are liable to return stale and
> invalid data on new connections. (In particular the test suite will
> crash, or on a good day just report an error, as it tries to use a new
> connection that just happens to have been allocated at the same location
> as the old one.)
> For cairo-xlib we call XAddExtension() and thus have a callback on
> XCloseDisplay(). There is no similar mechanism for xcb. Instead, as per
> the renderutil, you seem to favour an explicit call to
> xcb_render_util_disconnect() upon client disconnection, thus moving the
> burden of work onto the client. Carl Worth has already complained about me
> inflicting similar bookkeeping onto the user, and so I propose these
> callbacks before I incur his wrath again.
> Xcb mailing list
> Xcb at lists.freedesktop.org
More information about the Xcb