Window(s) overlaps status bar after xmonad is restarted

Hi, any advice how to prevent windows to overlap statusbar after xmonad is (re)started ? -- status bar is launched by the following code main = xmonad =<< statusBar "xmobar" myBarPP toggleStrutsKey myConfig -- base configuration structure passed to xmonad myConfig = defaultConfig { ... , layoutHook = myLayoutHook ... } -- layout hook contains avoidStructs modifier myLayoutHook = layoutHintsToCenter $ avoidStruts $ lessBorders OnlyFloat $ onWorkspace "9" simplestFloat $ named "Stacked" wmii ||| (lessBorders NoStatusBar Full) -- struts key definition for a completeness toggleStrutsKey _ = (myModMask, xK_b) An window like xterm overlaps xmobar at xmonad's restart only, 9 of 10 times. If I toggle xmobar visibility then, windows are properly placed in the free screen space (bellow xmobar or fill whole area if xmobar is hidden). Take care. David

On Sun, Aug 14, 2011 at 13:31, Dunric
myLayoutHook = layoutHintsToCenter $ avoidStruts $ lessBorders OnlyFloat $ onWorkspace "9" simplestFloat $ named "Stacked" wmii ||| (lessBorders NoStatusBar Full)
avoidStruts has to be the outermost modifier, otherwise layoutHintsToCenter could reposition windows over the strut. -- brandon s allbery allbery.b@gmail.com wandering unix systems administrator (available) (412) 475-9364 vm/sms

On Sun, Aug 14, 2011 at 13:31, Dunric
mailto:dunric29a@gmail.com> wrote: myLayoutHook = layoutHintsToCenter $ avoidStruts $ lessBorders OnlyFloat $ onWorkspace "9" simplestFloat $ named "Stacked" wmii ||| (lessBorders NoStatusBar Full)
avoidStruts has to be the outermost modifier, otherwise layoutHintsToCenter could reposition windows over the strut.
-- brandon s allbery allbery.b@gmail.com mailto:allbery.b@gmail.com wandering unix systems administrator (available) (412) 475-9364 vm/sms
I did placed avoidStruts as the first modifier but unfortunately without any effect. Take care. David

Dunric [2011.08.14 1931 +0200]:
Hi,
any advice how to prevent windows to overlap statusbar after xmonad is (re)started ?
As far as I know, this is a known issue and a minor one at that. Actually simply switching focus fixes the issue. It would be nice to understand why this happens and find a fix for it, though. Cheers, Norbert

Dunric [2011.08.14 1931 +0200]:
Hi,
any advice how to prevent windows to overlap statusbar after xmonad is (re)started ? As far as I know, this is a known issue and a minor one at that. Actually simply switching focus fixes the issue. It would be nice to understand why this happens and find a fix for it, though.
Cheers, Norbert
_______________________________________________ xmonad mailing list xmonad@haskell.org http://www.haskell.org/mailman/listinfo/xmonad
If it's a known issue, hope someone will finally fix it, although it's a minor "glitch". It looks like avoidStruts layout modifier is applied sooner then status bar is placed on screen. David

* On Sunday, August 14 2011, Norbert Zeh wrote:
Dunric [2011.08.14 1931 +0200]:
Hi,
any advice how to prevent windows to overlap statusbar after xmonad is (re)started ?
As far as I know, this is a known issue and a minor one at that. Actually simply switching focus fixes the issue. It would be nice to understand why this happens and find a fix for it, though.
Hi, I believe the issue is addressed by XMonad.Hooks.ManageDocks.docksEventHook added by this patch (which unfortunately isn't an xmonad-contrib on hackage): Tue Jul 6 14:58:34 EDT 2010 Tomas Janousek * X.H.ManageDocks: event hook to refresh on new docks -- Adam

* On Sunday, August 14 2011, Norbert Zeh wrote:
Dunric [2011.08.14 1931 +0200]:
Hi,
any advice how to prevent windows to overlap statusbar after xmonad is (re)started ? As far as I know, this is a known issue and a minor one at that. Actually simply switching focus fixes the issue. It would be nice to understand why this happens and find a fix for it, though. Hi,
I believe the issue is addressed by XMonad.Hooks.ManageDocks.docksEventHook added by this patch (which unfortunately isn't an xmonad-contrib on hackage):
Tue Jul 6 14:58:34 EDT 2010 Tomas Janousek * X.H.ManageDocks: event hook to refresh on new docks
-- Adam
_______________________________________________ xmonad mailing list xmonad@haskell.org http://www.haskell.org/mailman/listinfo/xmonad
Good point. I've found Tomas Janousek's diff and merged it into my xmonad.hs config: -- Whenever a new dock appears, refresh the layout immediately to avoid the -- new dock. docksEventHook :: Event -> X All docksEventHook (MapNotifyEvent {ev_window = w}) = do whenX ((not `fmap` (isClient w)) <&&> runQuery checkDock w) refresh return (All True) docksEventHook _ = return (All True) -- custom xmonad config myConfig = defaultConfig { ... -- custom event hook to refresh layout if new dock does appear , handleEventHook = docksEventHook ... } Now it does work flawlessly, issue is gone. I still find it rather as a hack than a bugfix but better then nothing :-) Haskell is sweet ... Take care David

On Sun, Aug 14, 2011 at 18:20, Dunric
Now it does work flawlessly, issue is gone. I still find it rather as a hack than a bugfix but better then nothing :-)
It's only a hack to the extent that you need to add that extra hook. There are a few other things that incorrectly assume it's enough to hook the logHook (notably FadeInactive) and thereby miss critical Map and Unmap events. I've actually been wondering if the right thing to do is for the core to invoke the logHook itself on those, since it's (almost?) always the right thing anyway. -- brandon s allbery allbery.b@gmail.com wandering unix systems administrator (available) (412) 475-9364 vm/sms
participants (4)
-
Adam Vogt
-
Brandon Allbery
-
Dunric
-
Norbert Zeh