diff options
author | Don Stewart <dons@cse.unsw.edu.au> | 2007-05-03 09:58:21 +0200 |
---|---|---|
committer | Don Stewart <dons@cse.unsw.edu.au> | 2007-05-03 09:58:21 +0200 |
commit | a10af6690d8f819156749314da49d481007ee616 (patch) | |
tree | a391537ba0f1eac723d37c9b4b5d8aea8c22fded /Operations.hs | |
parent | 17043e273444e89a947ce0a38f1de6f2da7f60f1 (diff) | |
download | xmonad-a10af6690d8f819156749314da49d481007ee616.tar.gz xmonad-a10af6690d8f819156749314da49d481007ee616.tar.xz xmonad-a10af6690d8f819156749314da49d481007ee616.zip |
comments. and stop tracing events to stderr
darcs-hash:20070503075821-9c5c1-d5bc043872adb9f95c23e0fde87ae11f16108785.gz
Diffstat (limited to 'Operations.hs')
-rw-r--r-- | Operations.hs | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/Operations.hs b/Operations.hs index 886d8ac..2207e2b 100644 --- a/Operations.hs +++ b/Operations.hs @@ -42,12 +42,13 @@ import qualified StackSet as W refresh :: X () refresh = do XState { workspace = ws, layoutDescs = fls } <- get - XConf { xineScreens = xinesc, display = d } <- ask + XConf { xineScreens = xinesc, display = d } <- ask -- neat, eh? flip mapM_ (M.assocs (W.screen2ws ws)) $ \(scn, n) -> do let sc = genericIndex xinesc scn -- temporary coercion! fl = M.findWithDefault defaultLayoutDesc n fls mapM_ (\(w, rect) -> io $ moveWindowInside d w rect) $ + -- likely this should just dispatch on the current layout algo case layoutType fl of Full -> fmap (flip (,) sc) $ maybeToList $ W.peekStack n ws Tall -> tile (tileFraction fl) sc $ W.index n ws @@ -63,11 +64,16 @@ clearEnterEvents = do io $ sync d False io $ allocaXEvent $ \p -> fix $ \again -> do more <- checkMaskEvent d enterWindowMask p - when more again + when more again -- beautiful -- | tile. Compute the positions for windows in horizontal layout -- mode. -- +-- Tiling algorithms in the core should satisify the constraint that +-- +-- * no windows overlap +-- * no gaps exist between windows. +-- tile :: Rational -> Rectangle -> [Window] -> [(Window, Rectangle)] tile _ _ [] = [] tile _ d [w] = [(w, d)] @@ -117,8 +123,7 @@ windows :: (WindowSet -> WindowSet) -> X () windows f = do modify $ \s -> s { workspace = f (workspace s) } refresh - ws <- gets workspace - trace (show ws) -- log state changes to stderr + -- gets workspace >>= trace . show -- log state changes to stderr -- | hide. Hide a window by moving it offscreen. hide :: Window -> X () |