diff --git a/Graphics/X11/ExtraTypes/XF86.hsc b/Graphics/X11/ExtraTypes/XF86.hsc
--- a/Graphics/X11/ExtraTypes/XF86.hsc
+++ b/Graphics/X11/ExtraTypes/XF86.hsc
@@ -688,6 +688,146 @@
 #else
          -- Skipping xF86XK_Music because your X doesn't define it
 #endif
+#ifdef XF86XK_Battery
+         xF86XK_Battery,             --  Display battery information
+#else
+         -- Skipping XF86XK_Battery because your X doesn't define it
+#endif
+#ifdef XF86XK_Bluetooth
+         xF86XK_Bluetooth,           --  Enable/disable Bluetooth
+#else
+         -- Skipping XF86XK_Bluetooth because your X doesn't define it
+#endif
+#ifdef XF86XK_WLAN
+         xF86XK_WLAN,                --  Enable/disable WLAN
+#else
+         -- Skipping XF86XK_WLAN because your X doesn't define it
+#endif
+#ifdef XF86XK_UWB
+         xF86XK_UWB,                 --  Enable/disable UWB
+#else
+         -- Skipping XF86XK_UWB because your X doesn't define it
+#endif
+#ifdef XF86XK_AudioForward,
+         xF86XK_AudioForward,        --  Fast-forward audio track
+#else
+         -- Skipping XF86XK_AudioForward because your X doesn't define it
+#endif
+#ifdef XF86XK_AudioRepeat
+         xF86XK_AudioRepeat,         --  Toggle repeat mode
+#else
+         -- Skipping XF86XK_AudioRepeat because your X doesn't define it
+#endif
+#ifdef XF86XK_AudioRandomPlay
+         xF86XK_AudioRandomPlay,     --  Toggle shuffle mode
+#else
+         -- Skipping XF86XK_AudioRandomPlay because your X doesn't define it
+#endif
+#ifdef XF86XK_Subtitle
+         xF86XK_Subtitle,            --  Cycle through subtitle
+#else
+         -- Skipping XF86XK_Subtitle because your X doesn't define it
+#endif
+#ifdef XF86XK_AudioCycleTrack
+         xF86XK_AudioCycleTrack,     --  Cycle through audio tracks
+#else
+         -- Skipping XF86XK_AudioCycleTrack because your X doesn't define it
+#endif
+#ifdef XF86XK_CycleAngle
+         xF86XK_CycleAngle,          --  Cycle through angles
+#else
+         -- Skipping XF86XK_CycleAngle because your X doesn't define it
+#endif
+#ifdef XF86XK_FrameBack
+         xF86XK_FrameBack,           --  Video: go one frame back
+#else
+         -- Skipping XF86XK_FrameBack because your X doesn't define it
+#endif
+#ifdef XF86XK_FrameForward
+         xF86XK_FrameForward,        --  Video: go one frame forward
+#else
+         -- Skipping XF86XK_FrameForward because your X doesn't define it
+#endif
+#ifdef XF86XK_Time
+         xF86XK_Time,                --  Display, or shows an entry for time seeking
+#else
+         -- Skipping XF86XK_Time because your X doesn't define it
+#endif
+#ifdef XF86XK_Select
+         xF86XK_Select,              --  Select button on joypads and remotes
+#else
+         -- Skipping XF86XK_Select because your X doesn't define it
+#endif
+#ifdef XF86XK_View
+         xF86XK_View,                --  Show a view options/properties
+#else
+         -- Skipping XF86XK_View because your X doesn't define it
+#endif
+#ifdef XF86XK_TopMenu
+         xF86XK_TopMenu,             --  Go to a top-level menu in a video
+#else
+         -- Skipping XF86XK_TopMenu because your X doesn't define it
+#endif
+#ifdef XF86XK_Red
+         xF86XK_Red,                 --  Red button
+#else
+         -- Skipping XF86XK_Red because your X doesn't define it
+#endif
+#ifdef XF86XK_Green
+         xF86XK_Green,               --  Green button
+#else
+         -- Skipping XF86XK_Green because your X doesn't define it
+#endif
+#ifdef XF86XK_Yellow
+         xF86XK_Yellow,              --  Yellow button
+#else
+         -- Skipping XF86XK_Yellow because your X doesn't define it
+#endif
+#ifdef XF86XK_Blue
+         xF86XK_Blue,                --  Blue button
+#else
+         -- Skipping XF86XK_Blue because your X doesn't define it
+#endif
+#ifdef XF86XK_Suspend
+         xF86XK_Suspend,             --  Sleep to RAM
+#else
+         -- Skipping XF86XK_Suspend because your X doesn't define it
+#endif
+#ifdef XF86XK_Hibernate
+         xF86XK_Hibernate,           --  Sleep to disk
+#else
+         -- Skipping XF86XK_Hibernate because your X doesn't define it
+#endif
+#ifdef XF86XK_TouchpadToggle
+         xF86XK_TouchpadToggle,      --  Toggle between touchpad/trackstick
+#else
+         -- Skipping XF86XK_TouchpadToggle because your X doesn't define it
+#endif
+#ifdef XF86XK_TouchpadOn
+         xF86XK_TouchpadOn,          --  The touchpad got switched on
+#else
+         -- Skipping XF86XK_TouchpadOn because your X doesn't define it
+#endif
+#ifdef XF86XK_TouchpadOff
+         xF86XK_TouchpadOff,         --  The touchpad got switched off
+#else
+         -- Skipping XF86XK_TouchpadOff because your X doesn't define it
+#endif
+#ifdef XF86XK_AudioMicMute
+         xF86XK_AudioMicMute,        --  Mute the Mic from the system
+#else
+         -- Skipping XF86XK_AudioMicMute because your X doesn't define it
+#endif
+#ifdef XF86XK_LogWindowTree
+         xF86XK_LogWindowTree,       --  Print window tree to log
+#else
+         -- Skipping XF86XK_LogWindowTree because your X doesn't define it
+#endif
+#ifdef XF86XK_LogGrabInfo
+         xF86XK_LogGrabInfo,         --  Print all active grabs to log
+#else
+         -- Skipping XF86XK_LogGrabInfo because your X doesn't define it
+#endif
 #ifdef XF86XK_Switch_VT_1
          xF86XK_Switch_VT_1,
 #else
@@ -1305,6 +1445,118 @@
 #ifdef XF86XK_Music
 xF86XK_Music                :: KeySym
 xF86XK_Music                = #const XF86XK_Music
+#endif
+#ifdef XF86XK_Battery
+xF86XK_Battery              :: KeySym
+xF86XK_Battery              = #const XF86XK_Battery
+#endif
+#ifdef XF86XK_Bluetooth
+xF86XK_Bluetooth            :: KeySym
+xF86XK_Bluetooth            = #const XF86XK_Bluetooth
+#endif
+#ifdef XF86XK_WLAN
+xF86XK_WLAN                 :: KeySym
+xF86XK_WLAN                 = #const XF86XK_WLAN
+#endif
+#ifdef XF86XK_UWB
+xF86XK_UWB                  :: KeySym
+xF86XK_UWB                  = #const XF86XK_UWB
+#endif
+#ifdef XF86XK_AudioForward
+xF86XK_AudioForward         :: KeySym
+xF86XK_AudioForward         = #const XF86XK_AudioForward
+#endif
+#ifdef XF86XK_AudioRepeat
+xF86XK_AudioRepeat          :: KeySym
+xF86XK_AudioRepeat          = #const XF86XK_AudioRepeat
+#endif
+#ifdef XF86XK_AudioRandomPlay
+xF86XK_AudioRandomPlay      :: KeySym
+xF86XK_AudioRandomPlay      = #const XF86XK_AudioRandomPlay
+#endif
+#ifdef XF86XK_Subtitle
+xF86XK_Subtitle             :: KeySym
+xF86XK_Subtitle             = #const XF86XK_Subtitle
+#endif
+#ifdef XF86XK_AudioCycleTrack
+xF86XK_AudioCycleTrack      :: KeySym
+xF86XK_AudioCycleTrack      = #const XF86XK_AudioCycleTrack
+#endif
+#ifdef XF86XK_CycleAngle
+xF86XK_CycleAngle           :: KeySym
+xF86XK_CycleAngle           = #const XF86XK_CycleAngle
+#endif
+#ifdef XF86XK_FrameBack
+xF86XK_FrameBack            :: KeySym
+xF86XK_FrameBack            = #const XF86XK_FrameBack
+#endif
+#ifdef XF86XK_FrameForward
+xF86XK_FrameForward         :: KeySym
+xF86XK_FrameForward         = #const XF86XK_FrameForward
+#endif
+#ifdef XF86XK_Time
+xF86XK_Time                 :: KeySym
+xF86XK_Time                 = #const XF86XK_Time
+#endif
+#ifdef XF86XK_Select
+xF86XK_Select               :: KeySym
+xF86XK_Select               = #const XF86XK_Select
+#endif
+#ifdef XF86XK_View
+xF86XK_View                 :: KeySym
+xF86XK_View                 = #const XF86XK_View
+#endif
+#ifdef XF86XK_TopMenu
+xF86XK_TopMenu              :: KeySym
+xF86XK_TopMenu              = #const XF86XK_TopMenu
+#endif
+#ifdef XF86XK_Red
+xF86XK_Red                  :: KeySym
+xF86XK_Red                  = #const XF86XK_Red
+#endif
+#ifdef XF86XK_Green
+xF86XK_Green                :: KeySym
+xF86XK_Green                = #const XF86XK_Green
+#endif
+#ifdef XF86XK_Yellow
+xF86XK_Yellow               :: KeySym
+xF86XK_Yellow               = #const XF86XK_Yellow
+#endif
+#ifdef XF86XK_Blue
+xF86XK_Blue                 :: KeySym
+xF86XK_Blue                 = #const XF86XK_Blue
+#endif
+#ifdef XF86XK_Suspend
+xF86XK_Suspend              :: KeySym
+xF86XK_Suspend              = #const XF86XK_Suspend
+#endif
+#ifdef XF86XK_Hibernate
+xF86XK_Hibernate            :: KeySym
+xF86XK_Hibernate            = #const XF86XK_Hibernate
+#endif
+#ifdef XF86XK_TouchpadToggle
+xF86XK_TouchpadToggle       :: KeySym
+xF86XK_TouchpadToggle       = #const XF86XK_TouchpadToggle
+#endif
+#ifdef XF86XK_TouchpadOn
+xF86XK_TouchpadOn           :: KeySym
+xF86XK_TouchpadOn           = #const XF86XK_TouchpadOn
+#endif
+#ifdef XF86XK_TouchpadOff
+xF86XK_TouchpadOff          :: KeySym
+xF86XK_TouchpadOff          = #const XF86XK_TouchpadOff
+#endif
+#ifdef XF86XK_AudioMicMute
+xF86XK_AudioMicMute         :: KeySym
+xF86XK_AudioMicMute         = #const XF86XK_AudioMicMute
+#endif
+#ifdef XF86XK_LogWindowTree
+xF86XK_LogWindowTree        :: KeySym
+xF86XK_LogWindowTree        = #const XF86XK_LogWindowTree
+#endif
+#ifdef XF86XK_LogGrabInfo
+xF86XK_LogGrabInfo          :: KeySym
+xF86XK_LogGrabInfo          = #const XF86XK_LogGrabInfo
 #endif
 #ifdef XF86XK_Switch_VT_1
 xF86XK_Switch_VT_1          :: KeySym
diff --git a/Graphics/X11/XScreenSaver.hsc b/Graphics/X11/XScreenSaver.hsc
--- a/Graphics/X11/XScreenSaver.hsc
+++ b/Graphics/X11/XScreenSaver.hsc
@@ -4,9 +4,9 @@
 -- Module    : Graphics.X11.XScreenSaver
 -- Copyright : (c) Joachim Breitner
 --             (c) Jochen Keil
--- License   : GPL2
+-- License   : BSD3
 --
--- Maintainer: Jochen Keil <jochen dot keil at gmail dot com>
+-- Maintainer: Joachim Breitner <mail@joachim-breitner.de>
 -- Stability : provisional
 -- Portability: portable
 --
diff --git a/Graphics/X11/Xlib/Color.hs b/Graphics/X11/Xlib/Color.hs
--- a/Graphics/X11/Xlib/Color.hs
+++ b/Graphics/X11/Xlib/Color.hs
@@ -35,7 +35,6 @@
 
 import Foreign
 import Foreign.C
-import Foreign.C.Types
 
 ----------------------------------------------------------------
 -- Color and Colormaps
diff --git a/Graphics/X11/Xlib/Context.hs b/Graphics/X11/Xlib/Context.hs
--- a/Graphics/X11/Xlib/Context.hs
+++ b/Graphics/X11/Xlib/Context.hs
@@ -46,7 +46,6 @@
 
 import Foreign
 import Foreign.C
-import Foreign.C.Types
 
 ----------------------------------------------------------------
 -- Graphics contexts
diff --git a/Graphics/X11/Xlib/Extras.hsc b/Graphics/X11/Xlib/Extras.hsc
--- a/Graphics/X11/Xlib/Extras.hsc
+++ b/Graphics/X11/Xlib/Extras.hsc
@@ -937,6 +937,8 @@
 -- TODO: this data type is incomplete wrt. the C struct
 data WindowAttributes = WindowAttributes
             { wa_x, wa_y, wa_width, wa_height, wa_border_width :: CInt
+            , wa_colormap :: Colormap
+            , wa_map_installed :: Bool
             , wa_map_state :: CInt
             , wa_override_redirect :: Bool
             }
@@ -959,6 +961,8 @@
                 `ap` (#{peek XWindowAttributes, width            } p)
                 `ap` (#{peek XWindowAttributes, height           } p)
                 `ap` (#{peek XWindowAttributes, border_width     } p)
+                `ap` (#{peek XWindowAttributes, colormap         } p)
+                `ap` (#{peek XWindowAttributes, map_installed    } p)
                 `ap` (#{peek XWindowAttributes, map_state        } p)
                 `ap` (#{peek XWindowAttributes, override_redirect} p)
     poke p wa = do
@@ -967,6 +971,8 @@
         #{poke XWindowAttributes, width            } p $ wa_width wa
         #{poke XWindowAttributes, height           } p $ wa_height wa
         #{poke XWindowAttributes, border_width     } p $ wa_border_width wa
+        #{poke XWindowAttributes, colormap         } p $ wa_colormap wa
+        #{poke XWindowAttributes, map_installed    } p $ wa_map_installed wa
         #{poke XWindowAttributes, map_state        } p $ wa_map_state wa
         #{poke XWindowAttributes, override_redirect} p $ wa_override_redirect wa
 
@@ -975,7 +981,7 @@
 
 getWindowAttributes :: Display -> Window -> IO WindowAttributes
 getWindowAttributes d w = alloca $ \p -> do
-    _ <- xGetWindowAttributes d w p
+    _ <- throwIfZero "getWindowAttributes" $ xGetWindowAttributes d w p
     peek p
 
 -- | interface to the X11 library function @XChangeWindowAttributes()@.
diff --git a/Graphics/X11/Xlib/Image.hs b/Graphics/X11/Xlib/Image.hs
--- a/Graphics/X11/Xlib/Image.hs
+++ b/Graphics/X11/Xlib/Image.hs
@@ -17,15 +17,19 @@
         createImage,
         putImage,
         destroyImage,
+        getImage,
+        xGetPixel,
+        getPixel
         ) where
 
 import Graphics.X11.Types
 import Graphics.X11.Xlib.Types
 
-import Foreign
--- import Foreign.C
+import Foreign (Ptr, throwIfNull)
 import Foreign.C.Types
 
+import System.IO.Unsafe (unsafePerformIO)
+
 ----------------------------------------------------------------
 -- Image
 ----------------------------------------------------------------
@@ -36,7 +40,7 @@
     image <- throwIfNull "createImage" (xCreateImage display vis depth format offset dat width height bitmap_pad bytes_per_line)
     return (Image image)
 foreign import ccall unsafe "HsXlib.h XCreateImage"
-    xCreateImage :: Display -> Visual -> CInt -> ImageFormat -> CInt -> 
+    xCreateImage :: Display -> Visual -> CInt -> ImageFormat -> CInt ->
         Ptr CChar -> Dimension -> Dimension -> CInt -> CInt -> IO (Ptr Image)
 
 -- | interface to the X11 library function @XPutImage()@.
@@ -48,13 +52,25 @@
 foreign import ccall unsafe "HsXlib.h XDestroyImage"
     destroyImage :: Image -> IO ()
 
+-- | interface to the X11 library function @XGetImage()@.
+getImage :: Display -> Drawable -> CInt -> CInt -> CUInt -> CUInt -> CULong -> ImageFormat -> IO Image
+getImage display d x y width height plane_mask format = do
+    image <- throwIfNull "getImage" (xGetImage display d x y width height plane_mask format)
+    return (Image image)
+
+foreign import ccall unsafe "HsXlib.h XGetImage"
+    xGetImage :: Display -> Drawable -> CInt -> CInt -> CUInt -> CUInt -> CULong -> ImageFormat -> IO (Ptr Image)
+
+foreign import ccall unsafe "HsXlib.h XGetPixel"
+    xGetPixel :: Image -> CInt -> CInt -> IO CULong
+
+-- | interface to the X11 library function @XGetPixel()@.
+getPixel :: Image -> CInt -> CInt -> CULong
+getPixel i x y = unsafePerformIO (xGetPixel i x y)
+
 {- don't need XInitImage since Haskell users probably won't be setting
 members of the XImage structure themselves -}
 -- XInitImage omitted
 
-{- these two functions are for fetching image data from a drawable
-back into an image struct. i'm not exactly sure when they would be
-used -}
--- XGetImage omitted
 -- XGetSubImage omitted
 
diff --git a/Graphics/X11/Xlib/Misc.hsc b/Graphics/X11/Xlib/Misc.hsc
--- a/Graphics/X11/Xlib/Misc.hsc
+++ b/Graphics/X11/Xlib/Misc.hsc
@@ -189,7 +189,6 @@
 import Foreign (Storable, Ptr, alloca, peek, throwIfNull, with, withArrayLen, allocaBytes, pokeByteOff, withArray, FunPtr, nullPtr, Word32, peekArray)
 import Foreign.C
 
-import Data.Default
 import System.IO.Unsafe
 
 #if __GLASGOW_HASKELL__
@@ -269,11 +268,11 @@
 
 -- | interface to the X11 library function @XGrabKey()@.
 foreign import ccall unsafe "HsXlib.h XGrabKey"
-        grabKey        :: Display -> KeyCode -> ButtonMask -> Window -> Bool -> GrabMode -> GrabMode -> IO ()
+        grabKey        :: Display -> KeyCode -> KeyMask -> Window -> Bool -> GrabMode -> GrabMode -> IO ()
 
 -- | interface to the X11 library function @XUngrabKey()@.
 foreign import ccall unsafe "HsXlib.h XUngrabKey"
-        ungrabKey      :: Display -> KeyCode -> ButtonMask -> Window -> IO ()
+        ungrabKey      :: Display -> KeyCode -> KeyMask -> Window -> IO ()
 
 -- | interface to the X11 library function @XGrabKeyboard()@.
 foreign import ccall unsafe "HsXlib.h XGrabKeyboard"
@@ -694,20 +693,6 @@
 -- | see @XVisualIDFromVisual()@
 foreign import ccall unsafe "HsXlib.h XVisualIDFromVisual"
         visualIDFromVisual :: Visual -> IO VisualID
-
-instance Default VisualInfo where
-    def = VisualInfo {
-        visualInfo_visual = Visual nullPtr,
-        visualInfo_visualID = 0,
-        visualInfo_screen = 0,
-        visualInfo_depth = 0,
-        visualInfo_class = 0,
-        visualInfo_redMask = 0,
-        visualInfo_greenMask = 0,
-        visualInfo_blueMask = 0,
-        visualInfo_colormapSize = 0,
-        visualInfo_bitsPerRGB = 0
-        }
 
 type VisualInfoMask = CLong
 #{enum VisualInfoMask,
diff --git a/Graphics/X11/Xlib/Types.hsc b/Graphics/X11/Xlib/Types.hsc
--- a/Graphics/X11/Xlib/Types.hsc
+++ b/Graphics/X11/Xlib/Types.hsc
@@ -35,6 +35,8 @@
 import Data.Data
 #endif
 
+import Data.Default
+
 #include "HsXlib.h"
 
 ----------------------------------------------------------------
@@ -107,6 +109,20 @@
 #else
         deriving (Eq, Show)
 #endif
+
+instance Default VisualInfo where
+    def = VisualInfo {
+        visualInfo_visual = Visual nullPtr,
+        visualInfo_visualID = 0,
+        visualInfo_screen = 0,
+        visualInfo_depth = 0,
+        visualInfo_class = 0,
+        visualInfo_redMask = 0,
+        visualInfo_greenMask = 0,
+        visualInfo_blueMask = 0,
+        visualInfo_colormapSize = 0,
+        visualInfo_bitsPerRGB = 0
+        }
 
 instance Storable VisualInfo where
         sizeOf _ = #size XVisualInfo
diff --git a/Graphics/X11/Xlib/Window.hs b/Graphics/X11/Xlib/Window.hs
--- a/Graphics/X11/Xlib/Window.hs
+++ b/Graphics/X11/Xlib/Window.hs
@@ -53,7 +53,6 @@
 
 import Foreign
 import Foreign.C
-import Foreign.C.Types
 
 ----------------------------------------------------------------
 -- Windows
diff --git a/Graphics/X11/Xrandr.hsc b/Graphics/X11/Xrandr.hsc
--- a/Graphics/X11/Xrandr.hsc
+++ b/Graphics/X11/Xrandr.hsc
@@ -23,6 +23,7 @@
   XRRScreenResources(..),
   XRROutputInfo(..),
   XRRCrtcInfo(..),
+  XRRPropertyInfo(..),
   compiledWithXrandr,
   Rotation,
   Reflection,
@@ -53,7 +54,12 @@
   xrrGetScreenResourcesCurrent,
   xrrSetOutputPrimary,
   xrrGetOutputPrimary,
-  xrrListOutputProperties
+  xrrListOutputProperties,
+  xrrQueryOutputProperty,
+  xrrConfigureOutputProperty,
+  xrrChangeOutputProperty,
+  xrrGetOutputProperty,
+  xrrDeleteOutputProperty
   ) where
 
 import Foreign
@@ -133,6 +139,14 @@
     , xrr_ci_possible     :: [RROutput]
     } deriving (Eq, Show)
 
+-- | Representation of the XRRPropertyInfo struct
+data XRRPropertyInfo = XRRPropertyInfo
+    { xrr_pi_pending      :: !Bool
+    , xrr_pi_range        :: !Bool
+    , xrr_pi_immutable    :: !Bool
+    , xrr_pi_values       :: [CLong]
+    } deriving (Eq, Show)
+
 -- We have Xrandr, so the library will actually work
 compiledWithXrandr :: Bool
 compiledWithXrandr = True
@@ -317,6 +331,27 @@
                           (#{peek XRRCrtcInfo, possible  } p)
 
 
+instance Storable XRRPropertyInfo where
+    sizeOf _ = #{size XRRPropertyInfo}
+    -- FIXME: Is this right?
+    alignment _ = alignment (undefined :: CInt)
+
+    poke p xrr_pi = do
+        #{poke XRRPropertyInfo, pending    } p $ xrr_pi_pending   xrr_pi
+        #{poke XRRPropertyInfo, range      } p $ xrr_pi_range     xrr_pi
+        #{poke XRRPropertyInfo, immutable  } p $ xrr_pi_immutable xrr_pi
+        -- see comment in Storable XRRScreenResources about dynamic resource allocation
+        #{poke XRRPropertyInfo, num_values } p ( 0 :: CInt )
+        #{poke XRRPropertyInfo, values     } p ( nullPtr :: Ptr CLong )
+
+    peek p = return XRRPropertyInfo
+        `ap` ( #{peek XRRPropertyInfo, pending   } p )
+        `ap` ( #{peek XRRPropertyInfo, range     } p )
+        `ap` ( #{peek XRRPropertyInfo, immutable } p )
+        `ap` peekCArrayIO ( #{peek XRRPropertyInfo, num_values} p)
+                          ( #{peek XRRPropertyInfo, values} p)
+
+
 xrrQueryExtension :: Display -> IO (Maybe (CInt, CInt))
 xrrQueryExtension dpy = wrapPtr2 (cXRRQueryExtension dpy) go
   where go False _ _                = Nothing
@@ -383,7 +418,6 @@
                                     sizes <- if nsizes == 0
                                                 then return Nothing
                                                 else peekArray (fromIntegral nsizes) p >>= return . Just
-                                    _ <- xFree p
                                     return sizes
 foreign import ccall "XRRConfigSizes"
   cXRRConfigSizes :: XRRScreenConfiguration -> Ptr CInt -> IO (Ptr XRRScreenSize)
@@ -398,7 +432,6 @@
                                     rates <- if nrates == 0
                                                 then return Nothing
                                                 else peekArray (fromIntegral nrates) p >>= return . Just
-                                    _ <- xFree p
                                     return rates
 foreign import ccall "XRRConfigRates"
   cXRRConfigRates :: XRRScreenConfiguration -> CInt -> Ptr CInt -> IO (Ptr CShort)
@@ -451,7 +484,6 @@
                                     sizes <- if nsizes == 0
                                                 then return Nothing
                                                 else peekArray (fromIntegral nsizes) p >>= return . Just
-                                    _ <- xFree p
                                     return sizes
 foreign import ccall "XRRSizes"
   cXRRSizes :: Display -> CInt -> Ptr CInt -> IO (Ptr XRRScreenSize)
@@ -466,7 +498,6 @@
                                     rates <- if nrates == 0
                                                 then return Nothing
                                                 else peekArray (fromIntegral nrates) p >>= return . Just
-                                    _ <- xFree p
                                     return rates
 foreign import ccall "XRRRates"
   cXRRRates :: Display -> CInt -> CInt -> Ptr CInt -> IO (Ptr CShort)
@@ -582,6 +613,85 @@
 
 foreign import ccall "XRRListOutputProperties"
     cXRRListOutputProperties :: Display -> RROutput -> Ptr CInt -> IO (Ptr Atom)
+
+xrrQueryOutputProperty :: Display -> RROutput -> Atom -> IO (Maybe XRRPropertyInfo)
+xrrQueryOutputProperty dpy rro prop = do
+    p <- cXRRQueryOutputProperty dpy rro prop
+    if p == nullPtr
+        then return Nothing
+        else do
+            res <- peek p
+            _ <- xFree p
+            return $ Just res
+
+foreign import ccall "XRRQueryOutputProperty"
+    cXRRQueryOutputProperty :: Display -> RROutput -> Atom -> IO (Ptr XRRPropertyInfo)
+
+xrrConfigureOutputProperty :: Display -> RROutput -> Atom -> Bool -> Bool -> [CLong] -> IO ()
+xrrConfigureOutputProperty dpy rro prop pend range xs = withArrayLen xs $
+    cXRRConfigureOutputProperty dpy rro prop pend range . fromIntegral
+
+foreign import ccall "XRRConfigureOutputProperty"
+    cXRRConfigureOutputProperty :: Display -> RROutput -> Atom -> Bool -> Bool -> CInt ->  Ptr CLong -> IO ()
+
+xrrChangeOutputProperty :: Display -> RROutput -> Atom -> Atom -> CInt -> CInt -> [Word32] -> IO ()
+xrrChangeOutputProperty dpy rro prop typ format mode xs = withPool $ \pool -> do
+    ptr <- case format of
+        8 ->  pooledNewArray pool (map fromIntegral xs :: [Word8])
+        16 -> castPtr `fmap` pooledNewArray pool (map fromIntegral xs :: [Word16])
+        32 -> castPtr `fmap` pooledNewArray pool xs
+        _  -> error "invalid format"
+
+    cXRRChangeOutputProperty dpy rro prop typ format mode ptr (fromIntegral $ length xs)
+
+foreign import ccall "XRRChangeOutputProperty"
+    cXRRChangeOutputProperty :: Display -> RROutput -> Atom -> Atom -> CInt -> CInt -> Ptr Word8 -> CInt -> IO ()
+
+-- | @xrrGetOutputProperty display output property offset length delete pending propertyType@
+-- | returns @Maybe (actualType, format, bytesAfter, data)@.
+xrrGetOutputProperty ::
+    Display -> RROutput -> Atom -> CLong -> CLong -> Bool -> Bool -> Atom ->
+    IO (Maybe (Atom, Int, CULong, [Word32]))
+xrrGetOutputProperty dpy rro prop offset len delete preferPending reqType = withPool $ \pool -> do
+    actualTypep <- pooledMalloc pool
+    actualFormatp <- pooledMalloc pool
+    nItemsp <- pooledMalloc pool
+    bytesAfterp <- pooledMalloc pool
+    datapp <- pooledMalloc pool
+    status <- cXRRGetOutputProperty dpy rro prop offset len
+        delete preferPending reqType
+        actualTypep actualFormatp nItemsp bytesAfterp datapp
+
+    if status /= 0
+        then return Nothing
+        else do
+          format <- fmap fromIntegral (peek actualFormatp)
+          nitems <- fmap fromIntegral (peek nItemsp)
+          ptr <- peek datapp
+
+          dat <- case format of
+            0 -> return []
+            8 -> fmap (map fromIntegral) $ peekArray nitems ptr
+            16 -> fmap (map fromIntegral) $ peekArray nitems (castPtr ptr :: Ptr Word16)
+            32 -> peekArray nitems (castPtr ptr :: Ptr Word32)
+            _  -> error $ "impossible happened: prop format is not in 0,8,16,32 (" ++ show format ++ ")"
+
+          _ <- if format /= 0
+                  then xFree ptr
+                  else return 0
+
+          typ <- peek actualTypep
+          bytesAfter <- peek bytesAfterp
+          return $ Just (typ, format, bytesAfter, dat)
+
+foreign import ccall "XRRGetOutputProperty"
+    cXRRGetOutputProperty :: Display -> RROutput -> Atom -> CLong -> CLong -> Bool -> Bool
+      -> Atom -> Ptr Atom -> Ptr CInt -> Ptr CULong -> Ptr CULong -> Ptr (Ptr Word8) -> IO CInt
+
+xrrDeleteOutputProperty :: Display -> RROutput -> Atom -> IO ()
+xrrDeleteOutputProperty = cXRRDeleteOutputProperty
+foreign import ccall "XRRDeleteOutputProperty"
+    cXRRDeleteOutputProperty :: Display -> RROutput -> Atom -> IO ()
 
 wrapPtr2 :: (Storable a, Storable b) => (Ptr a -> Ptr b -> IO c) -> (c -> a -> b -> d) -> IO d
 wrapPtr2 cfun f =
diff --git a/X11.cabal b/X11.cabal
--- a/X11.cabal
+++ b/X11.cabal
@@ -1,10 +1,11 @@
 name:               X11
-version:            1.6.1.2
+version:            1.7
 license:            BSD3
 license-file:       LICENSE
 copyright:          Alastair Reid, 1999-2003, libraries@haskell.org 2003-2007, Don Stewart 2007-2009, Spencer Janssen 2007-2009, Daniel Wagner 2009-2011.
 maintainer:         Daniel Wagner <daniel@wagner-home.com>
-homepage:           https://github.com/haskell-pkg-janitors/X11
+homepage:           https://github.com/xmonad/X11
+bug-reports:        https://github.com/xmonad/X11/issues
 category:           Graphics
 synopsis:           A binding to the X11 graphics library
 description:        A Haskell binding to the X11 graphics library.
@@ -20,9 +21,14 @@
     config.log config.status autom4te.cache
     config.mk X11.buildinfo include/HsX11Config.h
     include/X11_extras_config.h
-Cabal-Version: >= 1.2
+Cabal-Version: >= 1.6
 build-type:         Configure
+tested-with: GHC==7.6.3, GHC==7.8.4, GHC==7.10.3, GHC==8.0.1
 
+source-repository head
+  type:     git
+  location: https://github.com/xmonad/X11
+
 library
   exposed-modules:
       Graphics.X11,
@@ -63,6 +69,7 @@
   include-dirs:       include
   includes:           HsXlib.h, HsAllKeysyms.h
   install-includes:   HsXlib.h, XlibExtras.h, HsAllKeysyms.h
-  build-depends: base >= 3 && < 5, data-default
+  build-depends: base >= 4 && < 5, data-default
   ghc-options:        -funbox-strict-fields -Wall -fno-warn-unused-binds
-  ghc-prof-options:   -prof -auto-all
+  if impl(ghc >= 7.10)
+    ghc-options: -fno-warn-tabs
diff --git a/configure b/configure
--- a/configure
+++ b/configure
@@ -1,13 +1,11 @@
 #! /bin/sh
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.68 for Haskell X11 package 1.4.6.
+# Generated by GNU Autoconf 2.69 for Haskell X11 package 1.4.6.
 #
 # Report bugs to <dons@galois.com>.
 #
 #
-# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
-# 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software
-# Foundation, Inc.
+# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc.
 #
 #
 # This configure script is free software; the Free Software Foundation
@@ -136,6 +134,31 @@
 # CDPATH.
 (unset CDPATH) >/dev/null 2>&1 && unset CDPATH
 
+# Use a proper internal environment variable to ensure we don't fall
+  # into an infinite loop, continuously re-executing ourselves.
+  if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then
+    _as_can_reexec=no; export _as_can_reexec;
+    # We cannot yet assume a decent shell, so we have to provide a
+# neutralization value for shells without unset; and this also
+# works around shells that cannot unset nonexistent variables.
+# Preserve -v and -x to the replacement shell.
+BASH_ENV=/dev/null
+ENV=/dev/null
+(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
+case $- in # ((((
+  *v*x* | *x*v* ) as_opts=-vx ;;
+  *v* ) as_opts=-v ;;
+  *x* ) as_opts=-x ;;
+  * ) as_opts= ;;
+esac
+exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"}
+# Admittedly, this is quite paranoid, since all the known shells bail
+# out after a failed `exec'.
+$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2
+as_fn_exit 255
+  fi
+  # We don't want this to propagate to other subprocesses.
+          { _as_can_reexec=; unset _as_can_reexec;}
 if test "x$CONFIG_SHELL" = x; then
   as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then :
   emulate sh
@@ -169,7 +192,8 @@
 else
   exitcode=1; echo positional parameters were not saved.
 fi
-test x\$exitcode = x0 || exit 1"
+test x\$exitcode = x0 || exit 1
+test -x / || exit 1"
   as_suggested="  as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO
   as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO
   eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" &&
@@ -214,21 +238,25 @@
 
 
       if test "x$CONFIG_SHELL" != x; then :
-  # We cannot yet assume a decent shell, so we have to provide a
-	# neutralization value for shells without unset; and this also
-	# works around shells that cannot unset nonexistent variables.
-	# Preserve -v and -x to the replacement shell.
-	BASH_ENV=/dev/null
-	ENV=/dev/null
-	(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
-	export CONFIG_SHELL
-	case $- in # ((((
-	  *v*x* | *x*v* ) as_opts=-vx ;;
-	  *v* ) as_opts=-v ;;
-	  *x* ) as_opts=-x ;;
-	  * ) as_opts= ;;
-	esac
-	exec "$CONFIG_SHELL" $as_opts "$as_myself" ${1+"$@"}
+  export CONFIG_SHELL
+             # We cannot yet assume a decent shell, so we have to provide a
+# neutralization value for shells without unset; and this also
+# works around shells that cannot unset nonexistent variables.
+# Preserve -v and -x to the replacement shell.
+BASH_ENV=/dev/null
+ENV=/dev/null
+(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
+case $- in # ((((
+  *v*x* | *x*v* ) as_opts=-vx ;;
+  *v* ) as_opts=-v ;;
+  *x* ) as_opts=-x ;;
+  * ) as_opts= ;;
+esac
+exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"}
+# Admittedly, this is quite paranoid, since all the known shells bail
+# out after a failed `exec'.
+$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2
+exit 255
 fi
 
     if test x$as_have_required = xno; then :
@@ -331,6 +359,14 @@
 
 
 } # as_fn_mkdir_p
+
+# as_fn_executable_p FILE
+# -----------------------
+# Test if FILE is an executable regular file.
+as_fn_executable_p ()
+{
+  test -f "$1" && test -x "$1"
+} # as_fn_executable_p
 # as_fn_append VAR VALUE
 # ----------------------
 # Append the text in VALUE to the end of the definition contained in VAR. Take
@@ -452,6 +488,10 @@
   chmod +x "$as_me.lineno" ||
     { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; }
 
+  # If we had to re-execute with $CONFIG_SHELL, we're ensured to have
+  # already done that, so ensure we don't try to do so again and fall
+  # in an infinite loop.  This has already happened in practice.
+  _as_can_reexec=no; export _as_can_reexec
   # Don't try to exec as it changes $[0], causing all sort of problems
   # (the dirname of $[0] is not the place where we might find the
   # original and so on.  Autoconf is especially sensitive to this).
@@ -486,16 +526,16 @@
     # ... but there are two gotchas:
     # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
     # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
-    # In both cases, we have to default to `cp -p'.
+    # In both cases, we have to default to `cp -pR'.
     ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
-      as_ln_s='cp -p'
+      as_ln_s='cp -pR'
   elif ln conf$$.file conf$$ 2>/dev/null; then
     as_ln_s=ln
   else
-    as_ln_s='cp -p'
+    as_ln_s='cp -pR'
   fi
 else
-  as_ln_s='cp -p'
+  as_ln_s='cp -pR'
 fi
 rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
 rmdir conf$$.dir 2>/dev/null
@@ -507,28 +547,8 @@
   as_mkdir_p=false
 fi
 
-if test -x / >/dev/null 2>&1; then
-  as_test_x='test -x'
-else
-  if ls -dL / >/dev/null 2>&1; then
-    as_ls_L_option=L
-  else
-    as_ls_L_option=
-  fi
-  as_test_x='
-    eval sh -c '\''
-      if test -d "$1"; then
-	test -d "$1/.";
-      else
-	case $1 in #(
-	-*)set "./$1";;
-	esac;
-	case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #((
-	???[sx]*):;;*)false;;esac;fi
-    '\'' sh
-  '
-fi
-as_executable_p=$as_test_x
+as_test_x='test -x'
+as_executable_p=as_fn_executable_p
 
 # Sed expression to map a string onto a valid CPP name.
 as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
@@ -1134,8 +1154,6 @@
 if test "x$host_alias" != x; then
   if test "x$build_alias" = x; then
     cross_compiling=maybe
-    $as_echo "$as_me: WARNING: if you wanted to set the --build type, don't use --host.
-    If a cross compiler is detected then cross compile mode will be used" >&2
   elif test "x$build_alias" != "x$host_alias"; then
     cross_compiling=yes
   fi
@@ -1383,9 +1401,9 @@
 if $ac_init_version; then
   cat <<\_ACEOF
 Haskell X11 package configure 1.4.6
-generated by GNU Autoconf 2.68
+generated by GNU Autoconf 2.69
 
-Copyright (C) 2010 Free Software Foundation, Inc.
+Copyright (C) 2012 Free Software Foundation, Inc.
 This configure script is free software; the Free Software Foundation
 gives unlimited permission to copy, distribute and modify it.
 _ACEOF
@@ -1498,7 +1516,7 @@
 	 test ! -s conftest.err
        } && test -s conftest$ac_exeext && {
 	 test "$cross_compiling" = yes ||
-	 $as_test_x conftest$ac_exeext
+	 test -x conftest$ac_exeext
        }; then :
   ac_retval=0
 else
@@ -1752,7 +1770,7 @@
 running configure, to aid debugging if configure makes a mistake.
 
 It was created by Haskell X11 package $as_me 1.4.6, which was
-generated by GNU Autoconf 2.68.  Invocation command line was
+generated by GNU Autoconf 2.69.  Invocation command line was
 
   $ $0 $@
 
@@ -2142,7 +2160,7 @@
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_CC="${ac_tool_prefix}gcc"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -2182,7 +2200,7 @@
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_ac_ct_CC="gcc"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -2235,7 +2253,7 @@
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_CC="${ac_tool_prefix}cc"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -2276,7 +2294,7 @@
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
        ac_prog_rejected=yes
        continue
@@ -2334,7 +2352,7 @@
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -2378,7 +2396,7 @@
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_ac_ct_CC="$ac_prog"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -2824,8 +2842,7 @@
 /* end confdefs.h.  */
 #include <stdarg.h>
 #include <stdio.h>
-#include <sys/types.h>
-#include <sys/stat.h>
+struct stat;
 /* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
 struct buf { int x; };
 FILE * (*rcsopen) (struct buf *, struct stat *, int);
@@ -3818,7 +3835,7 @@
     for ac_prog in grep ggrep; do
     for ac_exec_ext in '' $ac_executable_extensions; do
       ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext"
-      { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue
+      as_fn_executable_p "$ac_path_GREP" || continue
 # Check for GNU ac_path_GREP and select it if it is found.
   # Check for GNU $ac_path_GREP
 case `"$ac_path_GREP" --version 2>&1` in
@@ -3884,7 +3901,7 @@
     for ac_prog in egrep; do
     for ac_exec_ext in '' $ac_executable_extensions; do
       ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext"
-      { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue
+      as_fn_executable_p "$ac_path_EGREP" || continue
 # Check for GNU ac_path_EGREP and select it if it is found.
   # Check for GNU $ac_path_EGREP
 case `"$ac_path_EGREP" --version 2>&1` in
@@ -4689,16 +4706,16 @@
     # ... but there are two gotchas:
     # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
     # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
-    # In both cases, we have to default to `cp -p'.
+    # In both cases, we have to default to `cp -pR'.
     ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
-      as_ln_s='cp -p'
+      as_ln_s='cp -pR'
   elif ln conf$$.file conf$$ 2>/dev/null; then
     as_ln_s=ln
   else
-    as_ln_s='cp -p'
+    as_ln_s='cp -pR'
   fi
 else
-  as_ln_s='cp -p'
+  as_ln_s='cp -pR'
 fi
 rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
 rmdir conf$$.dir 2>/dev/null
@@ -4758,29 +4775,17 @@
   as_mkdir_p=false
 fi
 
-if test -x / >/dev/null 2>&1; then
-  as_test_x='test -x'
-else
-  if ls -dL / >/dev/null 2>&1; then
-    as_ls_L_option=L
-  else
-    as_ls_L_option=
-  fi
-  as_test_x='
-    eval sh -c '\''
-      if test -d "$1"; then
-	test -d "$1/.";
-      else
-	case $1 in #(
-	-*)set "./$1";;
-	esac;
-	case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #((
-	???[sx]*):;;*)false;;esac;fi
-    '\'' sh
-  '
-fi
-as_executable_p=$as_test_x
 
+# as_fn_executable_p FILE
+# -----------------------
+# Test if FILE is an executable regular file.
+as_fn_executable_p ()
+{
+  test -f "$1" && test -x "$1"
+} # as_fn_executable_p
+as_test_x='test -x'
+as_executable_p=as_fn_executable_p
+
 # Sed expression to map a string onto a valid CPP name.
 as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
 
@@ -4801,7 +4806,7 @@
 # values after options handling.
 ac_log="
 This file was extended by Haskell X11 package $as_me 1.4.6, which was
-generated by GNU Autoconf 2.68.  Invocation command line was
+generated by GNU Autoconf 2.69.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
   CONFIG_HEADERS  = $CONFIG_HEADERS
@@ -4863,10 +4868,10 @@
 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
 ac_cs_version="\\
 Haskell X11 package config.status 1.4.6
-configured by $0, generated by GNU Autoconf 2.68,
+configured by $0, generated by GNU Autoconf 2.69,
   with options \\"\$ac_cs_config\\"
 
-Copyright (C) 2010 Free Software Foundation, Inc.
+Copyright (C) 2012 Free Software Foundation, Inc.
 This config.status script is free software; the Free Software Foundation
 gives unlimited permission to copy, distribute and modify it."
 
@@ -4954,7 +4959,7 @@
 _ACEOF
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 if \$ac_cs_recheck; then
-  set X '$SHELL' '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
+  set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
   shift
   \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6
   CONFIG_SHELL='$SHELL'
