aboutsummaryrefslogtreecommitdiffstats
path: root/XMonad/Hooks
diff options
context:
space:
mode:
authorDavid Roundy <droundy@darcs.net>2007-11-08 18:52:50 +0100
committerDavid Roundy <droundy@darcs.net>2007-11-08 18:52:50 +0100
commit7802891028dff79e7bfb14eaaaaf9ee5ebe312f3 (patch)
tree58d73d37ea0c8fd05261d28bb3b2993535ca0f37 /XMonad/Hooks
parentab78fe26bb3d6328f97a29a0658136cf34fe4590 (diff)
downloadXMonadContrib-7802891028dff79e7bfb14eaaaaf9ee5ebe312f3.tar.gz
XMonadContrib-7802891028dff79e7bfb14eaaaaf9ee5ebe312f3.tar.xz
XMonadContrib-7802891028dff79e7bfb14eaaaaf9ee5ebe312f3.zip
fix bug in avoidStruts.
I've now tested this module, and it works on x86--but doesn't work on x86-64, because ManageDocks doesn't work on 64-bit. But in any case, it works almost perfectly, with no user intervention needed (and no special hooks). The only catch is that it doesn't notice when a panel disappears, so the layout won't adjust until the next refresh (e.g. if you change focus, layout or workspace). darcs-hash:20071108175250-72aca-13b5c836f9b263465aee9fe7a5f1b1e875eb8f60.gz
Diffstat (limited to 'XMonad/Hooks')
-rw-r--r--XMonad/Hooks/ManageDocks.hs15
1 files changed, 14 insertions, 1 deletions
diff --git a/XMonad/Hooks/ManageDocks.hs b/XMonad/Hooks/ManageDocks.hs
index 481c047..09e52e2 100644
--- a/XMonad/Hooks/ManageDocks.hs
+++ b/XMonad/Hooks/ManageDocks.hs
@@ -16,6 +16,19 @@
-- It also allows you to reset the gap to reflect the state of current STRUT
-- windows (for example, after you resized or closed a panel), and to toggle the Gap
-- in a STRUT-aware fashion.
+
+-- The avoidStruts layout modifier allows you to make xmonad dynamically
+-- avoid overlapping windows with panels. You can (optionally) enable this
+-- on a selective basis, so that some layouts will effectively hide the
+-- panel, by placing windows on top of it. An example use of avoidStruts
+-- would be:
+
+-- > layoutHook = Layout $ toggleLayouts (noBorders Full) $ avoidStruts $
+-- > your actual layouts here ||| ...
+
+-- This would enable a full-screen mode that overlaps the panel, while all
+-- other layouts avoid the panel.
+
-----------------------------------------------------------------------------
module XMonad.Hooks.ManageDocks (
-- * Usage
@@ -144,7 +157,7 @@ data AvoidStruts l a = AvoidStruts (l a) deriving ( Read, Show )
instance LayoutClass l a => LayoutClass (AvoidStruts l) a where
doLayout (AvoidStruts lo) (Rectangle x y w h) s =
do (t,l,b,r) <- calcGap
- let rect = Rectangle (x+10+fromIntegral l) (y+fromIntegral t)
+ let rect = Rectangle (x+fromIntegral l) (y+fromIntegral t)
(w-fromIntegral l-fromIntegral r) (h-fromIntegral t-fromIntegral b)
(wrs,mlo') <- doLayout lo rect s
return (wrs, AvoidStruts `fmap` mlo')