[Xcb] Getting a Display handle from an xcb_connection_t

Josh Triplett josh at freedesktop.org
Mon Jan 7 20:19:53 PST 2008

Eamon Walsh wrote:
> Is there a way I can create an xlib Display handle from an existing XCB 
> connection?  In other words, the opposite of XGetXCBConnection?

Hmmm, interesting.  No such call currently exists.  We could
theoretically create one, and I don't know any fundamental reason we
shouldn't, other than that doing so would make it easy to shoot
yourself in the foot by pointing multiple Xlib displays at the same
XCB connection.  (If we did things *very* *very* carefully, we might
even manage to support *that*, but ow, let's not).

We could also make the one-and-only Xlib connection a singleton, by
keeping a reference to it in XCB, though that seems even uglier.

> To make a long story short, I'm in a situation where I can easily call 
> xcb_connect_to_display_with_auth_info(), but not XOpenDisplay() because 
> there is no equivalent Xlib call where I can just pass in the auth 
> information.

You can do that with Xlib, with the XSetAuthorization funtion.  That
works with either Xlib/XCB or legacy Xlib.  Don't let that stop you
from using XCB, though. :)

- Josh Triplett

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 252 bytes
Desc: OpenPGP digital signature
Url : http://lists.freedesktop.org/archives/xcb/attachments/20080107/d0c2a36c/attachment.pgp 

More information about the Xcb mailing list