diff options
author | Jose Antonio Ortega Ruiz <jao@gnu.org> | 2012-10-08 00:02:05 +0200 |
---|---|---|
committer | Jose Antonio Ortega Ruiz <jao@gnu.org> | 2012-10-08 00:02:05 +0200 |
commit | 44f99f3ed3a6af5a2289765fadf4df29887db5c2 (patch) | |
tree | 43c779aefe8828355dfbd8399f67af10b2186808 /src/Xmobar.hs | |
parent | b24a91af8d6a1f7b38012092ee786895b8b6a318 (diff) | |
download | xmobar-44f99f3ed3a6af5a2289765fadf4df29887db5c2.tar.gz xmobar-44f99f3ed3a6af5a2289765fadf4df29887db5c2.tar.bz2 |
Fixes for warnings reported in github issue #71
Diffstat (limited to 'src/Xmobar.hs')
-rw-r--r-- | src/Xmobar.hs | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/src/Xmobar.hs b/src/Xmobar.hs index f8db6a5..5fc0cd4 100644 --- a/src/Xmobar.hs +++ b/src/Xmobar.hs @@ -29,7 +29,7 @@ module Xmobar , drawInWin, printStrings ) where -import Prelude hiding (catch) +import Prelude import Graphics.X11.Xlib hiding (textExtents, textWidth) import Graphics.X11.Xlib.Extras import Graphics.X11.Xinerama @@ -39,7 +39,7 @@ import Control.Arrow ((&&&)) import Control.Monad.Reader import Control.Concurrent import Control.Concurrent.STM -import Control.Exception (catch, SomeException(..)) +import Control.Exception (handle, SomeException(..)) import Data.Bits import Config @@ -86,23 +86,22 @@ startLoop xcfg@(XConf _ _ w _ _) sig vs = do xftInitFtLibrary #endif tv <- atomically $ newTVar [] - _ <- forkIO (checker tv [] vs sig `catch` - \(SomeException _) -> void (putStrLn "Thread checker failed")) + _ <- forkIO (handle (handler "checker") (checker tv [] vs sig)) #ifdef THREADED_RUNTIME - _ <- forkOS (eventer sig `catch` + _ <- forkOS (handle (handler "eventer") (eventer sig)) #else - _ <- forkIO (eventer sig `catch` + _ <- forkIO (handle (handler "eventer") (eventer sig)) #endif - \(SomeException _) -> void (putStrLn "Thread eventer failed")) #ifdef DBUS runIPC sig #endif eventLoop tv xcfg sig where + handler thing (SomeException _) = + putStrLn ("Thread " ++ thing ++ " failed") >> return () -- Reacts on events from X eventer signal = allocaXEvent $ \e -> do - dpy <- openDisplay "" xrrSelectInput dpy (defaultRootWindow dpy) rrScreenChangeNotifyMask selectInput dpy w (exposureMask .|. structureNotifyMask) |