diff options
author | Jochen Keil <jochen.keil@gmail.com> | 2012-08-09 12:07:33 +0200 |
---|---|---|
committer | Jochen Keil <jochen.keil@gmail.com> | 2012-08-09 12:07:33 +0200 |
commit | 6c456e9e1f881fd70e9c1b357edfc5d63f7a3204 (patch) | |
tree | b85b614abc2d28344b521abc1ac63c05966b695b | |
parent | fc474471e12afd5ec958082a7246f2ee22fcc2cf (diff) | |
download | xmobar-6c456e9e1f881fd70e9c1b357edfc5d63f7a3204.tar.gz xmobar-6c456e9e1f881fd70e9c1b357edfc5d63f7a3204.tar.bz2 |
Bugfix: Do not hide the window when toggling is off for this pipe
The window became hidden although the toggling behaviour was set to
False for a particular pipe. This fixes this behaviour and hides the
window only if the configuration option is set to True.
-rw-r--r-- | src/Plugins/BufferedPipeReader.hs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/Plugins/BufferedPipeReader.hs b/src/Plugins/BufferedPipeReader.hs index 8a91967..be6a652 100644 --- a/src/Plugins/BufferedPipeReader.hs +++ b/src/Plugins/BufferedPipeReader.hs @@ -60,7 +60,7 @@ instance Exec BufferedPipeReader where (to, tg, dt, ntb) <- update cb dt when tg $ putMVar signal Reveal - when (to /= 0) $ sfork $ reset to ts ntb + when (to /= 0) $ sfork $ reset to tg ts ntb writer tc ts ntb where @@ -75,9 +75,9 @@ instance Exec BufferedPipeReader where tb <- newTVar True return (to, tg, dt, tb) - reset :: Int -> TMVar String -> TVar Bool -> IO () - reset to ts tb = do + reset :: Int -> Bool -> TMVar String -> TVar Bool -> IO () + reset to tg ts tb = do threadDelay ( to * 100 * 1000 ) readTVarIO tb >>= \b -> when b $ do - putMVar signal Hide + when tg $ putMVar signal Hide atomically (tryTakeTMVar ts) >>= maybe (return ()) cb |