aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--XMonad/Layout/Mosaic.hs9
1 files 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 ()