diff --git a/XMonad/Prelude.hs b/XMonad/Prelude.hs index 227211d1a4..1b8caa51fa 100644 --- a/XMonad/Prelude.hs +++ b/XMonad/Prelude.hs @@ -1,4 +1,5 @@ {-# LANGUAGE BangPatterns #-} +{-# LANGUAGE CPP #-} {-# LANGUAGE LambdaCase #-} -------------------------------------------------------------------- -- | @@ -127,8 +128,12 @@ keyToString = uncurry (++) . bimap (keymaskToString 0) keysymToString -- the X server already for compatibility reasons. For more info, see: -- cleanKeyMask :: X (KeyMask -> KeyMask) -cleanKeyMask = cleanKeyMask' <$> gets numberlockMask +#if MIN_VERSION_xmonad(0, 17, 1) +cleanKeyMask = cleanKeyMask' <$> join (asks (stripModMask . config)) +#else +cleanKeyMask = cleanKeyMask' . (lockMask .|.) <$> gets numberlockMask +#endif cleanKeyMask' :: KeyMask -> KeyMask -> KeyMask -cleanKeyMask' numLockMask mask = - mask .&. complement (numLockMask .|. lockMask) .&. (button1Mask - 1) +cleanKeyMask' stripMask mask = + mask .&. complement stripMask .&. (button1Mask - 1)