darcs patch: Changing Int to CInt and building with -D_XSERVER64 (w...

Chris Mears chris at cmears.id.au
Thu Mar 29 01:27:15 EDT 2007


thedward at antejentacular.org writes:

> Wed Mar 28 01:24:53 CDT 2007  thedward at antejentacular.org
>   * (Graphics.X11) Updates for (better) 64-bit compatibility
>   
>   Changing Int to CInt and building with -D_XSERVER64 (when
>   appropriate)

I am not sure if defining _XSERVER64 is the right fix.  The Xlib headers
say that:

/*
 * _XSERVER64 must ONLY be defined when compiling X server sources on
 * systems where unsigned long is not 32 bits, must NOT be used in
 * client or library code.
 */

Apparently on the server, XID should be 32-bit but in client code it
should be 64-bit (see, for example,
http://lists.freedesktop.org/archives/xorg/2006-August/017515.html).

This seems to cause a real problem in Xmonad, for example.  If I have
many windows open and start Xmonad, it scans for windows to manage via
XQueryTree.  I get the following list:

[6291457,0,6291469,0,6291735,0,6291780,0,6292217,0,6292266]

Each window has a 64-bit XID, but now the X11 bindings are processing
them as an array of 32-bit numbers, so I lose half of my windows (and
causes the list to be interspersed with zeroes; these are the upper 32
bits of each number).


More information about the Libraries mailing list