[Xcb] Getting a Display handle from an xcb_connection_t
Eamon Walsh
ewalsh at tycho.nsa.gov
Tue Jan 15 12:34:49 PST 2008
Josh Triplett wrote:
> 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.
>
I figured there were complex state issues associated with this. The
XSetAuthorization function did the trick for me. Thanks for the tip!
>
>> 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
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> Xcb mailing list
> Xcb at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/xcb
--
Eamon Walsh <ewalsh at tycho.nsa.gov>
National Security Agency
More information about the Xcb
mailing list