From aa6bc9f3e9cd1d4436ce14a3da099beee252c3aa Mon Sep 17 00:00:00 2001 From: Adam Vogt Date: Mon, 25 May 2009 05:07:34 +0200 Subject: Fix L.Mosaic bug where stored [Rational] was not extended Ignore-this: 55bb5b7fabc00f3dcc89e45cc416fc97 darcs-hash:20090525030734-1499c-4b2cbbb9441b51847777ddb33dcc1da68846a360.gz --- XMonad/Layout/Mosaic.hs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/XMonad/Layout/Mosaic.hs b/XMonad/Layout/Mosaic.hs index ec72611..9376f59 100644 --- a/XMonad/Layout/Mosaic.hs +++ b/XMonad/Layout/Mosaic.hs @@ -118,10 +118,15 @@ instance LayoutClass Mosaic a where rect = rects !! maybe (nls `div` 2) round (nextIx `fmap` state) state' = fmap (\x@(ov,_,_) -> (ov,nextIx x,pred nls)) state `mplus` Just (True,fromIntegral nls / 2,pred nls) - ss' | and $ zipWith (==) ss ssExt = ss - | otherwise = ssExt + ss' = maybe ss (const ss `either` const ssExt) $ zipRemain ss ssExt in return (zip (W.integrate st) rect, Just $ Mosaic state' delta ss') +zipRemain :: [a] -> [b] -> Maybe (Either [a] [b]) +zipRemain (_:xs) (_:ys) = zipRemain xs ys +zipRemain [] [] = Nothing +zipRemain [] y = Just (Right y) +zipRemain x [] = Just (Left x) + -- | These sample functions are meant to be applied to the list of window sizes -- through the 'SlopeMod' message. changeMaster :: (Rational -> Rational) -> X () -- cgit v1.2.3