X.U.Ungrab: Avoid "Ambiguous occurrence" error in user configs

This commit is contained in:
Tomas Janousek
2023-12-17 17:29:35 +00:00
parent d54a7e21dd
commit 3613d4d543

View File

@@ -1,3 +1,4 @@
{-# LANGUAGE CPP #-}
-----------------------------------------------------------------------------
-- |
-- Module : XMonad.Util.Ungrab
@@ -19,6 +20,9 @@ module XMonad.Util.Ungrab {-# DEPRECATED "Use XMonad.Operations.unGrab instead"
unGrab
) where
#if MIN_VERSION_xmonad(0, 17, 9)
import XMonad.Operations (unGrab)
#else
import Graphics.X11.Xlib (sync)
import Graphics.X11.Xlib.Extras (currentTime)
import Graphics.X11.Xlib.Misc (ungrabKeyboard, ungrabPointer)
@@ -43,3 +47,4 @@ import XMonad.Core
-- | Release xmonad's keyboard grab, so other grabbers can do their thing.
unGrab :: X ()
unGrab = withDisplay $ \d -> io (ungrabKeyboard d currentTime >> ungrabPointer d currentTime >> sync d False)
#endif