summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--src/Window.hs7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/Window.hs b/src/Window.hs
index 9b0c506..7ff1ffe 100644
--- a/src/Window.hs
+++ b/src/Window.hs
@@ -96,8 +96,11 @@ setProperties r c d w srs = do
setTextProperty d w "xmobar" wM_CLASS
setTextProperty d w "xmobar" wM_NAME
- changeProperty32 d w a1 c1 propModeReplace $ map fi $
- getStrutValues r (position c) (getRootWindowHeight srs)
+ ismapped <- isMapped d w
+ changeProperty32 d w a1 c1 propModeReplace $
+ if ismapped
+ then map fi $ getStrutValues r (position c) (getRootWindowHeight srs)
+ else replicate 12 0
changeProperty32 d w a2 c2 propModeReplace [fromIntegral v]
getProcessID >>= changeProperty32 d w p c1 propModeReplace . return . fromIntegral