[Haskell-cafe] X11 package bug: XClientMessageEvent long data

Dylan Alex Simon dylan-haskell at dylex.net
Wed Mar 16 05:10:59 CET 2011

Does anyone know the current maintenance status of the X11 package?  I emailed
Spencer Janssen a number of months ago and never heard back.  So, I'll put
this here in case any one else runs into it or can get it to the right place.

This is a proposed bug fix for a problem I ran into using xmonad client
messages to send remote commands on 64LP architectures (i.e., amd64), wherein
the C X11 library and Haskell's disagree about the size of client message

Tue Nov 16 23:41:49 EST 2010  Dylan Simon <dylan at dylex.net>
  * change XClientMessageEvent long data
  The XClientMessageEvent.data.l field is actually a long, not an int, so it must
  be interpreted as such, even though format is set to 32 in this case.
  Ostensibly this is an Xlib bug, but it is unlikely to be fixed there.
diff -rN -u old-src/Graphics/X11/Xlib/Extras.hsc new-src/Graphics/X11/Xlib/Extras.hsc
--- old-src/Graphics/X11/Xlib/Extras.hsc	2011-03-15 22:40:39.687844812 -0400
+++ new-src/Graphics/X11/Xlib/Extras.hsc	2011-03-15 22:40:39.724522814 -0400
@@ -601,7 +601,7 @@
                         16 -> do a <- peekArray 10 datPtr
                                  return $ map fromIntegral (a::[Word16])
                         32 -> do a <- peekArray 5 datPtr
-                                 return $ map fromIntegral (a::[Word32])
+                                 return $ map fromIntegral (a::[CLong])
                         _  -> error "X11.Extras.clientMessage: illegal value"
             return $ ClientMessageEvent
                         { ev_event_type    = type_

More information about the Haskell-Cafe mailing list