From 6c456e9e1f881fd70e9c1b357edfc5d63f7a3204 Mon Sep 17 00:00:00 2001
From: Jochen Keil <jochen.keil@gmail.com>
Date: Thu, 9 Aug 2012 12:07:33 +0200
Subject: 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.
---
 src/Plugins/BufferedPipeReader.hs | 8 ++++----
 1 file 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
-- 
cgit v1.2.3