From 2570b0d756121fb6314de514412b52f648d0fc25 Mon Sep 17 00:00:00 2001 From: Jochen Keil Date: Sun, 12 Aug 2012 10:39:08 +0200 Subject: Run the DBus/IPC handler only once on program start The startCommand function is called for every configured plugin. This results in multiple calls to runIPC. This it not necessary however. startLoop is a much more appropriate place, since the other signal handler (checker and eventer) are run here to. --- src/Xmobar.hs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/Xmobar.hs b/src/Xmobar.hs index fb0860d..d758301 100644 --- a/src/Xmobar.hs +++ b/src/Xmobar.hs @@ -87,6 +87,9 @@ startLoop xcfg@(XConf _ _ w _ conf) sig vs = do _ <- forkIO (eventer sig `catch` #endif \(SomeException _) -> void (putStrLn "Thread eventer failed")) +#ifdef DBUS + runIPC sig +#endif eventLoop tv xcfg sig where -- Reacts on events from X @@ -195,9 +198,6 @@ startCommand sig (com,s,ss) let cb str = atomically $ writeTVar var (s ++ str ++ ss) h <- forkIO $ start com cb _ <- forkIO $ trigger com ( maybe (return ()) (putMVar sig) ) -#ifdef DBUS - runIPC sig -#endif return (Just h,var) where is = s ++ "Updating..." ++ ss -- cgit v1.2.3