From 0934fe5cd75897474bfffc8fa6254a57dc549d5d Mon Sep 17 00:00:00 2001
From: Tony Zorman <soliditsallgood@mailbox.org>
Date: Tue, 2 Aug 2022 09:52:08 +0200
Subject: [PATCH] X.U.Grab: Hide mkGrabs from XMonad

With [1] merged, the XMonad module from core now exports mkGrabs and
setNumlockMask (now cacheNumlockMask).  However, since we want
xmonad-contrib 0.17.1 to compile against xmonad 0.17.0 still, hide the
function for now and continue to use the vendored copies we have in
X.U.Grab currently.  We have to ignore the dodgy-imports warning when
-fpedantic is on, but that seems like a small price to pay.

A breaking change for this is planned for 0.18.0.

[1]: https://github.com/xmonad/xmonad/pull/405
---
 XMonad/Util/Grab.hs  | 2 +-
 xmonad-contrib.cabal | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/XMonad/Util/Grab.hs b/XMonad/Util/Grab.hs
index 09f32e0fa6..b1ec2074c8 100644
--- a/XMonad/Util/Grab.hs
+++ b/XMonad/Util/Grab.hs
@@ -29,7 +29,7 @@ module XMonad.Util.Grab
   ) where
 
 -- core
-import           XMonad
+import           XMonad                         hiding (mkGrabs)
 
 import           Control.Monad                  ( when )
 import           Data.Bits                      ( setBit )
diff --git a/xmonad-contrib.cabal b/xmonad-contrib.cabal
index 957d8f462d..fa0e3ac7da 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
+       ghc-options: -Werror -Wwarn=deprecations -Wwarn=dodgy-imports
 
     -- Keep this in sync with the oldest version in 'tested-with'
     if impl(ghc > 8.4.4)
@@ -478,7 +478,7 @@ test-suite tests
   default-language: Haskell2010
 
   if flag(pedantic)
-     ghc-options: -Werror -Wwarn=deprecations
+     ghc-options: -Werror -Wwarn=deprecations -Wwarn=dodgy-imports
 
   -- Keep this in sync with the oldest version in 'tested-with'
   if impl(ghc > 8.4.4)