aboutsummaryrefslogtreecommitdiffstats
path: root/XMonad
diff options
context:
space:
mode:
authorLukas Mai <l.mai@web.de>2008-07-17 22:51:38 +0200
committerLukas Mai <l.mai@web.de>2008-07-17 22:51:38 +0200
commit892ec2de7654fd1d321d97be443e477d18aa18fa (patch)
treeac49623c8046ffcb24b32cd0c9fe7b28103a11bd /XMonad
parent4c7daa88fa27fedea1d7b45c2ccd27cdea68b60a (diff)
downloadXMonadContrib-892ec2de7654fd1d321d97be443e477d18aa18fa.tar.gz
XMonadContrib-892ec2de7654fd1d321d97be443e477d18aa18fa.tar.xz
XMonadContrib-892ec2de7654fd1d321d97be443e477d18aa18fa.zip
Grid/HintedGrid: prefer wider windows
darcs-hash:20080717205138-462cf-c688ae9b5e4909d12e5e3ac58400a28fcad584c0.gz
Diffstat (limited to 'XMonad')
-rw-r--r--XMonad/Layout/Grid.hs2
-rw-r--r--XMonad/Layout/HintedGrid.hs2
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