[Xcb] Mixing xlib/xcb with self-generated protocol?

Jamey Sharp jamey at minilop.net
Tue Oct 21 08:51:06 PDT 2008


On Mon, Oct 20, 2008 at 11:58:23PM +0200, Clemens Eisserer wrote:
> Will the socket-handoff mechanism allow to mix&match xlib and
> self-generated protocol?

You can do that without handoff, by calling xcb_send_request directly
for each request you want to issue.

But yes, if you want to send larger batches of requests, you can call
xcb_take_socket, then repeatedly xcb_writev until XCB calls the
return_socket callback you provided and you return from it.

XCB doesn't care who currently owns the socket. If somebody else asks
for the socket, XCB waits for the current owner to be done and then
gives it to the new owner. So Xlib can take ownership of the socket for
a while, and then a hypothetical Intercal language binding can take
over, and then your self-generated protocol bits can take over, and then
you can make some calls through XCB's protocol stubs which means XCB
itself owns the socket again. And all of this is thread-safe, barring
implementation bugs.

Hope that helps,
Jamey
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: Digital signature
Url : http://lists.freedesktop.org/archives/xcb/attachments/20081021/78b50f82/attachment.pgp 


More information about the Xcb mailing list