diff --git a/XMonad/Util/Grab.hs b/XMonad/Util/Grab.hs index b1ec2074c..66b2872e5 100644 --- a/XMonad/Util/Grab.hs +++ b/XMonad/Util/Grab.hs @@ -29,7 +29,7 @@ module XMonad.Util.Grab ) where -- core -import XMonad hiding (mkGrabs) +import XMonad import Control.Monad ( when ) import Data.Bits ( setBit ) @@ -88,49 +88,9 @@ customRegrabEvHook regr = \case e@MappingNotifyEvent{} -> do io (refreshKeyboardMapping e) when (ev_request e `elem` [mappingKeyboard, mappingModifier]) - $ setNumlockMask + $ cacheNumlockMask >> regr pure (All False) _ -> pure (All True) -- }}} - --- --< Private Utils >-- {{{ - --- | Private action shamelessly copied and restyled from XMonad.Main source. -setNumlockMask :: X () -setNumlockMask = withDisplay $ \dpy -> do - ms <- io (getModifierMapping dpy) - xs <- sequence - [ do - ks <- io (keycodeToKeysym dpy kc 0) - pure $ if ks == xK_Num_Lock - then setBit 0 (fromIntegral m) - else 0 :: KeyMask - | (m, kcs) <- ms - , kc <- kcs - , kc /= 0 - ] - modify $ \s -> s { numberlockMask = foldr (.|.) 0 xs } - --- | Private function shamelessly copied and refactored from XMonad.Main source. -mkGrabs :: X ([(KeyMask, KeySym)] -> [(KeyMask, KeyCode)]) -mkGrabs = withDisplay $ \dpy -> do - let (minCode, maxCode) = displayKeycodes dpy - allCodes = [fromIntegral minCode .. fromIntegral maxCode] - syms <- io . for allCodes $ \code -> keycodeToKeysym dpy code 0 - let keysymMap = M.fromListWith (++) (zip syms $ pure <$> allCodes) - keysymToKeycodes sym = M.findWithDefault [] sym keysymMap - extraMods <- extraModifiers - pure $ \ks -> do - (mask, sym) <- ks - keycode <- keysymToKeycodes sym - extraMod <- extraMods - pure (mask .|. extraMod, keycode) - --- }}} - - --- NOTE: there is some duplication between this module and core. The --- latter probably will never change, but this needs to be kept in sync --- with any potential bugs that might arise. diff --git a/xmonad-contrib.cabal b/xmonad-contrib.cabal index 881f8759b..edc564474 100644 --- a/xmonad-contrib.cabal +++ b/xmonad-contrib.cabal @@ -76,7 +76,7 @@ library ghc-options: -Wall -Wno-unused-do-bind if flag(pedantic) - ghc-options: -Werror -Wwarn=deprecations -Wwarn=dodgy-imports + ghc-options: -Werror -Wwarn=deprecations -- Keep this in sync with the oldest version in 'tested-with' if impl(ghc > 8.6.5) @@ -496,7 +496,7 @@ test-suite tests default-language: Haskell2010 if flag(pedantic) - ghc-options: -Werror -Wwarn=deprecations -Wwarn=dodgy-imports + ghc-options: -Werror -Wwarn=deprecations -- Keep this in sync with the oldest version in 'tested-with' if impl(ghc > 8.6.5)