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
@@ -708,7 +708,7 @@
 #else
          -- Skipping XF86XK_UWB because your X doesn't define it
 #endif
-#ifdef XF86XK_AudioForward,
+#ifdef XF86XK_AudioForward
          xF86XK_AudioForward,        --  Fast-forward audio track
 #else
          -- Skipping XF86XK_AudioForward because your X doesn't define it
diff --git a/Graphics/X11/Types.hsc b/Graphics/X11/Types.hsc
--- a/Graphics/X11/Types.hsc
+++ b/Graphics/X11/Types.hsc
@@ -435,10 +435,8 @@
         rrCrtcChangeNotifyMask,
         rrOutputChangeNotifyMask,
         rrOutputPropertyNotifyMask,
-#ifdef HAVE_X11_EXTENSIONS_SCRNSAVER_H
         screenSaverCycleMask,
         screenSaverNotifyMask,
-#endif
 
         -- ** Event types
         EventType,
@@ -481,9 +479,7 @@
         rrNotifyOutputChange,
         rrNotifyOutputProperty,
         lASTEvent,
-#ifdef HAVE_X11_EXTENSIONS_SCRNSAVER_H
         screenSaverNotify,
-#endif
 
         -- ** Modifiers
         Modifier,
@@ -1296,10 +1292,8 @@
  , rrCrtcChangeNotifyMask       = RRCrtcChangeNotifyMask
  , rrOutputChangeNotifyMask     = RROutputChangeNotifyMask
  , rrOutputPropertyNotifyMask   = RROutputPropertyNotifyMask
-#ifdef HAVE_X11_EXTENSIONS_SCRNSAVER_H
  , screenSaverCycleMask         = ScreenSaverCycleMask
  , screenSaverNotifyMask        = ScreenSaverNotifyMask
-#endif
  }
 
 type EventType          = Word32
@@ -1343,9 +1337,7 @@
  , rrNotifyOutputChange = RRNotify_OutputChange
  , rrNotifyOutputProperty=RRNotify_OutputProperty
  , lASTEvent            = LASTEvent
-#ifdef HAVE_X11_EXTENSIONS_SCRNSAVER_H
  , screenSaverNotify    = ScreenSaverNotify
-#endif
  }
 
 type Modifier           = CUInt
diff --git a/Graphics/X11/XScreenSaver.hsc b/Graphics/X11/XScreenSaver.hsc
--- a/Graphics/X11/XScreenSaver.hsc
+++ b/Graphics/X11/XScreenSaver.hsc
@@ -15,10 +15,6 @@
 -- Interface to XScreenSaver API
 --
 
-#include <HsX11Config.h>
-
-#ifdef HAVE_X11_EXTENSIONS_SCRNSAVER_H
-
 module Graphics.X11.XScreenSaver (
     getXIdleTime,
     XScreenSaverState(..),
@@ -106,10 +102,12 @@
 getXIdleTime dpy =
     maybe 0 (fromIntegral . xssi_idle) `fmap` xScreenSaverQueryInfo dpy
 
--- We have XScreenSaver, so the library will actually work
+-- | We have XScreenSaver, so the library will actually work
 compiledWithXScreenSaver :: Bool
 compiledWithXScreenSaver = True
+{-# DEPRECATED compiledWithXScreenSaver "X11 now always compiles with XScreenSaver support" #-}
 
+
 -- for XFree() (already included from scrnsaver.h, but I don't know if I can
 -- count on that.)
 #include <X11/Xlib.h>
@@ -425,10 +423,3 @@
 
 foreign import ccall "XScreenSaverSuspend"
     cXScreenSaverSuspend :: Display -> Bool -> IO ()
-
-#else
-module Graphics.X11.XScreenSaver where
-
-compiledWithXScreenSaver :: Bool
-compiledWithXScreenSaver = False
-#endif
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
@@ -19,9 +19,7 @@
 import Data.Maybe
 import Data.Typeable ( Typeable )
 import Graphics.X11.Xrandr
-#ifdef HAVE_X11_EXTENSIONS_SCRNSAVER_H
 import Graphics.X11.XScreenSaver
-#endif
 import Graphics.X11.Xlib
 import Graphics.X11.Xlib.Internal
 import Graphics.X11.Xlib.Types
@@ -297,7 +295,6 @@
         , ev_timestamp             :: !Time
         , ev_rr_state              :: !CInt
         }
-#ifdef HAVE_X11_EXTENSIONS_SCRNSAVER_H
     | ScreenSaverNotifyEvent
         { ev_event_type            :: !EventType
         , ev_serial                :: !CULong
@@ -310,7 +307,6 @@
         , ev_forced                :: !Bool
         , ev_time                  :: !Time
         }
-#endif
     deriving ( Show, Typeable )
 
 eventTable :: [(EventType, String)]
@@ -349,9 +345,7 @@
     , (clientMessage        , "ClientMessage")
     , (mappingNotify        , "MappingNotify")
     , (lASTEvent            , "LASTEvent")
-#ifdef HAVE_X11_EXTENSIONS_SCRNSAVER_H
     , (screenSaverNotify    , "ScreenSaverNotify")
-#endif
     ]
 
 eventName :: Event -> String
@@ -852,7 +846,6 @@
                                 , ev_subtype       = subtype
                                 }
 
-#ifdef HAVE_X11_EXTENSIONS_SCRNSAVER_H
           -----------------
           -- ScreenSaverNotifyEvent:
           -----------------
@@ -864,7 +857,6 @@
                 `ap` (#{peek XScreenSaverNotifyEvent, kind       } p )
                 `ap` (#{peek XScreenSaverNotifyEvent, forced     } p )
                 `ap` (#{peek XScreenSaverNotifyEvent, time       } p )
-#endif
 
           -- We don't handle this event specifically, so return the generic
           -- AnyEvent.
@@ -952,7 +944,7 @@
     alloca $ \parent_return ->
     alloca $ \children_return ->
     alloca $ \nchildren_return -> do
-        _ <- xQueryTree d w root_return parent_return children_return nchildren_return
+        _ <- throwIfZero "queryTree" $ xQueryTree d w root_return parent_return children_return nchildren_return
         p <- peek children_return
         n <- fmap fromIntegral $ peek nchildren_return
         ws <- peekArray n p
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
@@ -753,7 +753,7 @@
 foreign import ccall unsafe "HsXlib.h XLockDisplay"
         lockDisplay :: Display -> IO ()
 
-foreign import ccall unsafe "HsXlib.h XLockDisplay"
+foreign import ccall unsafe "HsXlib.h XUnlockDisplay"
         unlockDisplay :: Display -> IO ()
 
 ----------------------------------------------------------------
diff --git a/X11.cabal b/X11.cabal
--- a/X11.cabal
+++ b/X11.cabal
@@ -1,5 +1,5 @@
 name:               X11
-version:            1.8
+version:            1.9
 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.
diff --git a/configure b/configure
--- a/configure
+++ b/configure
@@ -686,7 +686,6 @@
 enable_x11
 with_x
 with_xinerama
-with_xscreensaver
 with_xorg_keysym
 '
       ac_precious_vars='build_alias
@@ -1320,7 +1319,6 @@
   --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
   --with-x                use the X Window System
   --without-xinerama      do not build Xinerama support
-  --without-xscreensaver  do not build XScreenSaver support
   --without-xorg-keysym   do not build X.org keysym support
 
 Some influential environment variables:
@@ -4115,21 +4113,7 @@
     as_fn_error $? "X11/extensions/Xrandr.h (from libXrandr) is required" "$LINENO" 5
 fi
 
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build XScreenSaver" >&5
-$as_echo_n "checking whether to build XScreenSaver... " >&6; }
-
-# Check whether --with-xscreensaver was given.
-if test "${with_xscreensaver+set}" = set; then :
-  withval=$with_xscreensaver;
-else
-  with_xscreensaver=yes
-fi
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_xscreensaver" >&5
-$as_echo "$with_xscreensaver" >&6; }
-
-if test "$with_xscreensaver" = yes; then
-    for ac_header in X11/extensions/scrnsaver.h
+for ac_header in X11/extensions/scrnsaver.h
 do :
   ac_fn_c_check_header_mongrel "$LINENO" "X11/extensions/scrnsaver.h" "ac_cv_header_X11_extensions_scrnsaver_h" "$ac_includes_default"
 if test "x$ac_cv_header_X11_extensions_scrnsaver_h" = xyes; then :
@@ -4141,14 +4125,10 @@
 
 done
 
-    if test "$have_xscreensaver" = yes; then
-        EXTRA_LIBRARIES="Xss $EXTRA_LIBRARIES"
-    else
-        echo "WARNING: XScreenSaver headers not found. Building without XScreenSaver support"
-    fi
-else
-    echo "WARNING: Building without XScreenSaver support per user request"
+if ! test "$have_xscreensaver" = yes; then
+    as_fn_error $? "X11/extensions/scrnsaver.h (from libXss) is required" "$LINENO" 5
 fi
+EXTRA_LIBRARIES="Xss $EXTRA_LIBRARIES"
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to include X.org keysyms" >&5
 $as_echo_n "checking whether to include X.org keysyms... " >&6; }
diff --git a/configure.ac b/configure.ac
--- a/configure.ac
+++ b/configure.ac
@@ -76,23 +76,11 @@
     AC_MSG_ERROR([X11/extensions/Xrandr.h (from libXrandr) is required])
 fi
 
-AC_MSG_CHECKING([whether to build XScreenSaver])
-AC_ARG_WITH(xscreensaver,
-            AS_HELP_STRING([--without-xscreensaver], [do not build XScreenSaver support]),
-            [],
-            [with_xscreensaver=yes])
-AC_MSG_RESULT([$with_xscreensaver])
-
-if test "$with_xscreensaver" = yes; then
-    AC_CHECK_HEADERS([X11/extensions/scrnsaver.h], [have_xscreensaver=yes])
-    if test "$have_xscreensaver" = yes; then
-        EXTRA_LIBRARIES="Xss $EXTRA_LIBRARIES"
-    else
-        echo "WARNING: XScreenSaver headers not found. Building without XScreenSaver support"
-    fi
-else
-    echo "WARNING: Building without XScreenSaver support per user request"
+AC_CHECK_HEADERS([X11/extensions/scrnsaver.h], [have_xscreensaver=yes])
+if ! test "$have_xscreensaver" = yes; then
+    AC_MSG_ERROR([X11/extensions/scrnsaver.h (from libXss) is required])
 fi
+EXTRA_LIBRARIES="Xss $EXTRA_LIBRARIES"
 
 AC_MSG_CHECKING([whether to include X.org keysyms])
 AC_ARG_WITH(xorg-keysym,
diff --git a/include/HsXlib.h b/include/HsXlib.h
--- a/include/HsXlib.h
+++ b/include/HsXlib.h
@@ -19,10 +19,7 @@
 #include <X11/Xutil.h>
 
 #include <X11/extensions/Xrandr.h>
-
-#ifdef HAVE_X11_EXTENSIONS_SCRNSAVER_H
 #include <X11/extensions/scrnsaver.h>
-#endif
 
 /* Xutil.h overrides some functions with macros.
  * In recent versions of X this can be turned off with
diff --git a/include/XlibExtras.h b/include/XlibExtras.h
--- a/include/XlibExtras.h
+++ b/include/XlibExtras.h
@@ -18,10 +18,7 @@
 #include <X11/Xproto.h>
 
 #include <X11/extensions/Xrandr.h>
-
-#ifdef HAVE_X11_EXTENSIONS_SCRNSAVER_H
 #include <X11/extensions/scrnsaver.h>
-#endif
 
 /* Xutil.h overrides some functions with macros.
  * In recent versions of X this can be turned off with
