diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/Window.hs | 3 | ||||
| -rw-r--r-- | src/Xmobar.hs | 30 | 
2 files changed, 15 insertions, 18 deletions
| diff --git a/src/Window.hs b/src/Window.hs index 29e1516..4678046 100644 --- a/src/Window.hs +++ b/src/Window.hs @@ -159,8 +159,7 @@ hideWindow d w = do      a <- internAtom d "_NET_WM_STRUT_PARTIAL"    False      c <- internAtom d "CARDINAL"                 False      changeProperty32 d w a c propModeReplace $ replicate 12 0 -    unmapWindow d w -    sync d False +    unmapWindow d w >> sync d False  showWindow :: Rectangle -> Config -> Display -> Window -> IO ()  showWindow r cfg d w = do diff --git a/src/Xmobar.hs b/src/Xmobar.hs index d2d29ad..9bec6bc 100644 --- a/src/Xmobar.hs +++ b/src/Xmobar.hs @@ -156,24 +156,22 @@ eventLoop tv xc@(XConf d r w fs cfg) signal = do      where          isPersistent = not $ persistent cfg -        hide t | t == 0    = do -            when isPersistent $ hideWindow d w -            eventLoop tv xc signal -               | otherwise = do -            void $ forkIO -                 $ threadDelay t >> atomically (putTMVar signal $ Hide 0) -            eventLoop tv xc signal +        hide t +            | t == 0 = +                when isPersistent (hideWindow d w) >> eventLoop tv xc signal +            | otherwise = do +                void $ forkIO +                     $ threadDelay t >> atomically (putTMVar signal $ Hide 0) +                eventLoop tv xc signal -        reveal t | t == 0 = -            if isPersistent -                then do -                showWindow r cfg d w +        reveal t +            | t == 0 = do +                when isPersistent (showWindow r cfg d w) +                eventLoop tv xc signal +            | otherwise = do +                void $ forkIO +                     $ threadDelay t >> atomically (putTMVar signal $ Reveal 0)                  eventLoop tv xc signal -            else eventLoop tv xc signal -                 | otherwise = do -            void $ forkIO -                 $ threadDelay t >> atomically (putTMVar signal $ Reveal 0) -            eventLoop tv xc signal          toggle t = do              ismapped <- isMapped d w | 
