summaryrefslogtreecommitdiffhomepage
path: root/src/Xmobar.hs
diff options
context:
space:
mode:
authorJose Antonio Ortega Ruiz <jao@gnu.org>2012-06-04 02:37:26 +0200
committerJose Antonio Ortega Ruiz <jao@gnu.org>2012-06-04 02:37:26 +0200
commitb465bbffb9d15dd76cd9d0c46e098ee60ace4f20 (patch)
tree9b74716c616ec4d477d15c6c0c370b6da2755440 /src/Xmobar.hs
parentc87df01f1d1eef7ccd5fb1d03282c6cdb341ce5b (diff)
downloadxmobar-b465bbffb9d15dd76cd9d0c46e098ee60ace4f20.tar.gz
xmobar-b465bbffb9d15dd76cd9d0c46e098ee60ace4f20.tar.bz2
Added --with_threaded configuration flag
Fixes #36
Diffstat (limited to 'src/Xmobar.hs')
-rw-r--r--src/Xmobar.hs10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/Xmobar.hs b/src/Xmobar.hs
index 2358a20..c348f99 100644
--- a/src/Xmobar.hs
+++ b/src/Xmobar.hs
@@ -1,4 +1,4 @@
-{-# LANGUAGE DeriveDataTypeable #-}
+{-# LANGUAGE DeriveDataTypeable, CPP #-}
-----------------------------------------------------------------------------
-- |
-- Module : Xmobar
@@ -84,7 +84,11 @@ startLoop xcfg@(XConf _ _ w _ _) vs = do
sig <- setupSignalHandler
_ <- forkIO (checker tv [] vs sig `catch`
\(SomeException _) -> void (putStrLn "Thread checker failed"))
+#ifdef THREADED_RUNTIME
+ _ <- forkOS (eventer sig `catch`
+#else
_ <- forkIO (eventer sig `catch`
+#endif
\(SomeException _) -> void (putStrLn "Thread eventer failed"))
eventLoop tv xcfg sig
where
@@ -97,7 +101,11 @@ startLoop xcfg@(XConf _ _ w _ _) vs = do
selectInput dpy w (exposureMask .|. structureNotifyMask)
forever $ do
+#ifdef THREADED_RUNTIME
+ nextEvent dpy e
+#else
nextEvent' dpy e
+#endif
ev <- getEvent e
case ev of
ConfigureEvent {} -> putMVar signal Reposition