From 892ec2de7654fd1d321d97be443e477d18aa18fa Mon Sep 17 00:00:00 2001 From: Lukas Mai Date: Thu, 17 Jul 2008 22:51:38 +0200 Subject: Grid/HintedGrid: prefer wider windows darcs-hash:20080717205138-462cf-c688ae9b5e4909d12e5e3ac58400a28fcad584c0.gz --- XMonad/Layout/Grid.hs | 2 +- XMonad/Layout/HintedGrid.hs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/XMonad/Layout/Grid.hs b/XMonad/Layout/Grid.hs index 070bd2f..33c4461 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 = max 1 . round . sqrt $ fromIntegral nwins * fromIntegral rw / (fromIntegral rh :: Double) + ncols = max 1 . round . sqrt $ fromIntegral nwins * 9 * fromIntegral rw / (16 * fromIntegral rh :: Double) mincs = nwins `div` ncols extrs = nwins - ncols * mincs chop :: Int -> Dimension -> [(Position, Dimension)] diff --git a/XMonad/Layout/HintedGrid.hs b/XMonad/Layout/HintedGrid.hs index 3b14b08..f8a52c3 100644 --- a/XMonad/Layout/HintedGrid.hs +++ b/XMonad/Layout/HintedGrid.hs @@ -109,7 +109,7 @@ arrange' :: D -> [D -> D] -> [Rectangle] arrange' (rw, rh) adjs = reverse $ doRect rh rw (fromIntegral ncolumns) (ecols ++ cols) where nwindows = length adjs - ncolumns = max 1 . round . sqrt $ fromIntegral nwindows * fromIntegral rw / (fromIntegral rh :: Double) + ncolumns = max 1 . round . sqrt $ fromIntegral nwindows * 9 * fromIntegral rw / (16 * fromIntegral rh :: Double) nrows = nwindows `div` ncolumns nextras = nwindows - ncolumns * nrows (ecols, adjs') = replicateS nextras (splitAt (nrows + 1)) $ reverse adjs -- cgit v1.2.3