Why does getWindowProperty32 return IO (Maybe [CLong])
ss7m opened this issue · comments
On most machines, a CLong
would be 64 bits rather than 32 bits. This causes issues where for any 32 bit property, getWindowProperty32
will be reading more bytes than are actually present. Sensible C types were chosen for getWindowProperty8
and getWindowProperty16
, so I'm wondeirng if there's a reason to use CLong
for 32 bit properties rather than CInt
(or even something like Word32
).
The XGetWindowProperty
manpage says:
If the returned format is 32, the returned data is represented as a long array and should be cast to that type to obtain the elements.
so that probably explains why it's a CLong
rather than a CInt
. Lots of things in Xlib are long
(and thus 64-bit on x64_64/amd64) even though they were meant to be 32-bit.
I guess I should have RTFM. (Along with the authors of every code example I've seen where people use 32 bit integers for these properties.)