aboutsummaryrefslogtreecommitdiffstats
path: root/XMonad/Util
diff options
context:
space:
mode:
Diffstat (limited to 'XMonad/Util')
-rw-r--r--XMonad/Util/NamedWindows.hs6
-rw-r--r--XMonad/Util/Run.hs7
-rw-r--r--XMonad/Util/XSelection.hs6
3 files changed, 11 insertions, 8 deletions
diff --git a/XMonad/Util/NamedWindows.hs b/XMonad/Util/NamedWindows.hs
index 17e401f..653eb54 100644
--- a/XMonad/Util/NamedWindows.hs
+++ b/XMonad/Util/NamedWindows.hs
@@ -24,7 +24,7 @@ module XMonad.Util.NamedWindows (
import Prelude hiding ( catch )
import Control.Applicative ( (<$>) )
-import Control.Exception ( bracket, catch )
+import Control.Exception.Extensible ( bracket, catch, SomeException(..) )
import Data.Maybe ( fromMaybe, listToMaybe )
import qualified XMonad.StackSet as W ( peek )
@@ -50,11 +50,11 @@ getName w = withDisplay $ \d -> do
let getIt = bracket getProp (xFree . tp_value) (fmap (`NW` w) . copy)
getProp = (internAtom d "_NET_WM_NAME" False >>= getTextProperty d w)
- `catch` \_ -> getTextProperty d w wM_NAME
+ `catch` \(SomeException _) -> getTextProperty d w wM_NAME
copy prop = fromMaybe "" . listToMaybe <$> wcTextPropertyToTextList d prop
- io $ getIt `catch` \_ -> ((`NW` w) . resName) `fmap` getClassHint d w
+ io $ getIt `catch` \(SomeException _) -> ((`NW` w) . resName) `fmap` getClassHint d w
unName :: NamedWindow -> Window
unName (NW _ w) = w
diff --git a/XMonad/Util/Run.hs b/XMonad/Util/Run.hs
index c884818..2afdae5 100644
--- a/XMonad/Util/Run.hs
+++ b/XMonad/Util/Run.hs
@@ -33,8 +33,9 @@ module XMonad.Util.Run (
import System.Posix.IO
import System.Posix.Process (executeFile)
+import System.Posix.Types (ProcessID)
import Control.Concurrent (threadDelay)
-import Control.Exception (try) -- use OldException with base 4
+import Control.Exception.Extensible (try,SomeException)
import System.IO
import System.Process (runInteractiveProcess)
import XMonad
@@ -107,7 +108,9 @@ it makes use of shell interpretation by relying on @$HOME@ and
interpolation, whereas the safeSpawn example can be safe because
Firefox doesn't need any arguments if it is just being started. -}
safeSpawn :: MonadIO m => FilePath -> [String] -> m ()
-safeSpawn prog args = liftIO (try (xfork $ executeFile prog True args Nothing) >> return ())
+safeSpawn prog args = liftIO $ do
+ try $ xfork $ executeFile prog True args Nothing :: IO (Either SomeException ProcessID)
+ return ()
-- | Like 'safeSpawn', but only takes a program (and no arguments for it). eg.
--
diff --git a/XMonad/Util/XSelection.hs b/XMonad/Util/XSelection.hs
index ad660c6..2dc68e6 100644
--- a/XMonad/Util/XSelection.hs
+++ b/XMonad/Util/XSelection.hs
@@ -22,7 +22,7 @@ module XMonad.Util.XSelection ( -- * Usage
transformPromptSelection,
transformSafePromptSelection) where
-import Control.Exception as E (catch)
+import Control.Exception.Extensible as E (catch,SomeException(..))
import Control.Monad (liftM, join)
import Data.Maybe (fromMaybe)
import XMonad
@@ -66,8 +66,8 @@ getSelection = io $ do
ty <- E.catch
(E.catch
(internAtom dpy "UTF8_STRING" False)
- (\_ -> internAtom dpy "COMPOUND_TEXT" False))
- (\_ -> internAtom dpy "sTring" False)
+ (\(E.SomeException _) -> internAtom dpy "COMPOUND_TEXT" False))
+ (\(E.SomeException _) -> internAtom dpy "sTring" False)
clp <- internAtom dpy "BLITZ_SEL_STRING" False
xConvertSelection dpy p ty clp win currentTime
allocaXEvent $ \e -> do