diff options
author | Jan Vornberger <jan.vornberger@informatik.uni-oldenburg.de> | 2010-06-02 23:50:48 +0200 |
---|---|---|
committer | Jan Vornberger <jan.vornberger@informatik.uni-oldenburg.de> | 2010-06-02 23:50:48 +0200 |
commit | 683b9ac521a32a662c86f3f607fdd6d4e51f7a95 (patch) | |
tree | 6910b6210eb7e7bcb8342f920d8edf1c2e02646a /XMonad/Hooks | |
parent | 8e244d61031ac0833cefdfe5879db34b5478bdc4 (diff) | |
download | XMonadContrib-683b9ac521a32a662c86f3f607fdd6d4e51f7a95.tar.gz XMonadContrib-683b9ac521a32a662c86f3f607fdd6d4e51f7a95.tar.xz XMonadContrib-683b9ac521a32a662c86f3f607fdd6d4e51f7a95.zip |
PositionStoreHook: take docks into account
Ignore-this: 6ffa63f22e9b511a9d28bc1c04195a08
darcs-hash:20100602215048-594c5-43fa479fd3dd4b34dbc38097d2f8540a0b7ebe89.gz
Diffstat (limited to 'XMonad/Hooks')
-rw-r--r-- | XMonad/Hooks/PositionStoreHooks.hs | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/XMonad/Hooks/PositionStoreHooks.hs b/XMonad/Hooks/PositionStoreHooks.hs index 484a2cb..0f96b83 100644 --- a/XMonad/Hooks/PositionStoreHooks.hs +++ b/XMonad/Hooks/PositionStoreHooks.hs @@ -37,12 +37,14 @@ import XMonad import qualified XMonad.StackSet as W import XMonad.Util.PositionStore import XMonad.Util.XUtils (fi) +import XMonad.Hooks.ManageDocks import System.Random(randomRIO) import Control.Applicative((<$>)) import Control.Monad(when) import Data.Maybe import Data.Monoid +import qualified Data.Set as S -- $usage -- You can use this module with the following in your @~\/.xmonad\/xmonad.hs@: @@ -80,9 +82,12 @@ positionStoreInit w = withDisplay $ \d -> do else do sc <- fromMaybe (W.current ws) <$> pointScreen (fi $ wa_x wa) (fi $ wa_y wa) let sr = screenRect . W.screenDetail $ sc + sr' <- fmap ($ sr) (calcGap $ S.fromList [minBound .. maxBound]) -- take docks into account, accepting + -- a somewhat unfortunate inter-dependency + -- with 'XMonad.Hooks.ManageDocks' modifyPosStore (\ps -> posStoreInsert ps w (Rectangle (fi $ wa_x wa) (fi $ wa_y wa) - (fi $ wa_width wa) (fi $ wa_height wa)) sr ) + (fi $ wa_width wa) (fi $ wa_height wa)) sr' ) where randomIntOffset :: X (Int) randomIntOffset = io $ randomRIO (42, 242) |