From c619e54c3545f8750610939297fffb3d430bf09f Mon Sep 17 00:00:00 2001 From: Lukas Mai Date: Wed, 2 Apr 2008 03:21:26 +0200 Subject: Grid/HintedGrid: use an ncolumns formula inspired by dwm's "optimal" mode darcs-hash:20080402012126-462cf-702c8178aefecd7feacc9fac0fe6774957acaf85.gz --- XMonad/Layout/Grid.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'XMonad/Layout/Grid.hs') diff --git a/XMonad/Layout/Grid.hs b/XMonad/Layout/Grid.hs index 6dcd1bb..070bd2f 100644 --- a/XMonad/Layout/Grid.hs +++ b/XMonad/Layout/Grid.hs @@ -46,7 +46,7 @@ arrange :: Rectangle -> [a] -> [(a, Rectangle)] arrange (Rectangle rx ry rw rh) st = zip st rectangles where nwins = length st - ncols = ceiling . (sqrt :: Double -> Double) . fromIntegral $ nwins + ncols = max 1 . round . sqrt $ fromIntegral nwins * fromIntegral rw / (fromIntegral rh :: Double) mincs = nwins `div` ncols extrs = nwins - ncols * mincs chop :: Int -> Dimension -> [(Position, Dimension)] -- cgit v1.2.3