summaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorJochen Keil <jochen.keil@gmail.com>2012-09-01 21:36:27 +0200
committerJochen Keil <jochen.keil@gmail.com>2012-09-01 21:36:27 +0200
commit922dfa2cfac8b546c2a6c76421533f102804bb87 (patch)
treef76709b25586e5494f3fddc817c440a413e3d99e /src
parentacd461339779e281b67d1906e0d208a6ee109a0a (diff)
downloadxmobar-922dfa2cfac8b546c2a6c76421533f102804bb87.tar.gz
xmobar-922dfa2cfac8b546c2a6c76421533f102804bb87.tar.bz2
Send hide or reveal signal for toggling
This is a more abstract way of implementing the Toggle operation.
Diffstat (limited to 'src')
-rw-r--r--src/Xmobar.hs5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/Xmobar.hs b/src/Xmobar.hs
index f531cb4..6be0d0c 100644
--- a/src/Xmobar.hs
+++ b/src/Xmobar.hs
@@ -176,7 +176,10 @@ eventLoop tv xc@(XConf d _ w fs cfg) signal = do
$ threadDelay t >> atomically (putTMVar signal $ Reveal 0)
eventLoop tv xc signal
- toggle t = isMapped d w >>= \b -> if b then hide t else reveal t
+ toggle t = do
+ ismapped <- isMapped d w
+ atomically (putTMVar signal $ if ismapped then Hide t else Reveal t)
+ eventLoop tv xc signal
reposWindow rcfg = do
r' <- repositionWin d w fs rcfg