From 8ccd5aa759175d204dccd0b580a3477ab23747f2 Mon Sep 17 00:00:00 2001 From: Jochen Keil Date: Sat, 1 Sep 2012 21:40:42 +0200 Subject: Set StrutValues only if window is actually mapped For a ChangeScreen or Reposition signal the setProperties function is called which sets the StrutValues regardless of the mapping state. This means that for an unmapped window a window manager will produce an empty gap. Fixing this is easy. Just set the StrutValues to 0. --- src/Window.hs | 7 +++++-- 1 file 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 -- cgit v1.2.3