[Xcb] Connecting to an X Server
doomster at knuut.de
Mon Aug 4 22:17:43 PDT 2008
On Tuesday 05 August 2008 04:38:10 Antoine Latter wrote:
> I'm trying to work out how the initial setup with an X server is
> negotiated, and I'm not sure if the problems I'm having are due to not
> understanding X or not understand the language I'm working with
> (Haskell, for the curious).
> After I get a handle to the server the first thing I do is send down
> my 10-byte setup-request, which consists of:
> And then I wait for the setup response which never comes. Is there
> something else I'm supposed to be sending? If I add two bytes of
> padding onto the end, I get a response all of the sudden.
What you could do is run xtrace on it. IOW you run 'xtrace -k' in one terminal
window and then connect to it using 'DISPLAY=:9 ./yourprogram' in another
(Note: the ':9' might differ). If xtrace fails to decode your connection
attempt, there is probably something wrong. Also, you can use that to see how
output is supposed to look like from a working program.
> This is on Mac OS 10.5, connecting to the file-socket pointed to by
> $DISPLAY (that is, $DISPLAY looks like a literal path to a
> file-socket, so I'm using that).
You could try an example program using xcb_connect_to_fd() instead of the
normal xcb_connect(). If that works, you at least know that you opened the
socket in a way that can be used.
More information about the Xcb