mirror of
https://github.com/xmonad/xmonad-contrib.git
synced 2025-05-19 11:30:22 -07:00
Address warnings from Debug modules
The warnings were related to ghc-7.6 removing Prelude.catch (triggering warnings regarding the import hiding it), as well as defaulting of some numeric types.
This commit is contained in:
parent
265df96ab8
commit
9caedf2fff
@ -19,7 +19,7 @@
|
|||||||
|
|
||||||
module XMonad.Hooks.DebugEvents (debugEventsHook) where
|
module XMonad.Hooks.DebugEvents (debugEventsHook) where
|
||||||
|
|
||||||
import Prelude hiding (catch)
|
import Prelude
|
||||||
|
|
||||||
import XMonad hiding (windowEvent
|
import XMonad hiding (windowEvent
|
||||||
,(-->)
|
,(-->)
|
||||||
@ -30,7 +30,7 @@ import XMonad.Util.DebugWindow (debugWindow)
|
|||||||
|
|
||||||
-- import Graphics.X11.Xlib.Extras.GetAtomName (getAtomName)
|
-- import Graphics.X11.Xlib.Extras.GetAtomName (getAtomName)
|
||||||
|
|
||||||
import Control.Exception.Extensible
|
import Control.Exception.Extensible as E
|
||||||
import Control.Monad.State
|
import Control.Monad.State
|
||||||
import Control.Monad.Reader
|
import Control.Monad.Reader
|
||||||
import Data.Char (isDigit)
|
import Data.Char (isDigit)
|
||||||
@ -855,7 +855,7 @@ dumpPixmap = guardType pIXMAP $ do
|
|||||||
append $ "pixmap " ++ showHex p ""
|
append $ "pixmap " ++ showHex p ""
|
||||||
g' <- inX $ withDisplay $ \d -> io $
|
g' <- inX $ withDisplay $ \d -> io $
|
||||||
Just `fmap` getGeometry d (fromIntegral p)
|
Just `fmap` getGeometry d (fromIntegral p)
|
||||||
`catch`
|
`E.catch`
|
||||||
\e -> case fromException e of
|
\e -> case fromException e of
|
||||||
Just x -> throw e `const` (x `asTypeOf` ExitSuccess)
|
Just x -> throw e `const` (x `asTypeOf` ExitSuccess)
|
||||||
_ -> return Nothing
|
_ -> return Nothing
|
||||||
@ -1032,7 +1032,8 @@ dumpPercent = guardType cARDINAL $ do
|
|||||||
Nothing -> return False
|
Nothing -> return False
|
||||||
Just n' ->
|
Just n' ->
|
||||||
let pct = 100 * fromIntegral n' / fromIntegral (maxBound :: Word32)
|
let pct = 100 * fromIntegral n' / fromIntegral (maxBound :: Word32)
|
||||||
in append $ show (round pct) ++ "%"
|
pct :: Double
|
||||||
|
in append $ show (round pct :: Integer) ++ "%"
|
||||||
|
|
||||||
dumpWmHints :: Decoder Bool
|
dumpWmHints :: Decoder Bool
|
||||||
dumpWmHints =
|
dumpWmHints =
|
||||||
|
@ -15,12 +15,12 @@
|
|||||||
|
|
||||||
module XMonad.Util.DebugWindow (debugWindow) where
|
module XMonad.Util.DebugWindow (debugWindow) where
|
||||||
|
|
||||||
import Prelude hiding (catch)
|
import Prelude
|
||||||
|
|
||||||
import XMonad
|
import XMonad
|
||||||
|
|
||||||
import Codec.Binary.UTF8.String (decodeString)
|
import Codec.Binary.UTF8.String (decodeString)
|
||||||
import Control.Exception
|
import Control.Exception.Extensible as E
|
||||||
import Control.Monad (when)
|
import Control.Monad (when)
|
||||||
import Data.List (unfoldr
|
import Data.List (unfoldr
|
||||||
,intercalate
|
,intercalate
|
||||||
@ -117,7 +117,7 @@ catchX' :: X a -> X a -> X a
|
|||||||
catchX' job errcase = do
|
catchX' job errcase = do
|
||||||
st <- get
|
st <- get
|
||||||
c <- ask
|
c <- ask
|
||||||
(a, s') <- io $ runX c st job `catch` \e -> case fromException e of
|
(a, s') <- io $ runX c st job `E.catch` \e -> case fromException e of
|
||||||
Just x -> throw e `const` (x `asTypeOf` ExitSuccess)
|
Just x -> throw e `const` (x `asTypeOf` ExitSuccess)
|
||||||
_ -> runX c st errcase
|
_ -> runX c st errcase
|
||||||
put s'
|
put s'
|
||||||
|
Loading…
x
Reference in New Issue
Block a user