From a10af6690d8f819156749314da49d481007ee616 Mon Sep 17 00:00:00 2001 From: Don Stewart Date: Thu, 3 May 2007 09:58:21 +0200 Subject: comments. and stop tracing events to stderr darcs-hash:20070503075821-9c5c1-d5bc043872adb9f95c23e0fde87ae11f16108785.gz --- Operations.hs | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'Operations.hs') 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 () -- cgit v1.2.3