Merge pull request #266 from LSLeary/master

Fix to X.L.Grid as per issue #223
This commit is contained in:
LSLeary
2018-07-09 05:34:45 +12:00
committed by GitHub
2 changed files with 6 additions and 1 deletions

View File

@@ -188,6 +188,11 @@
### Bug Fixes and Minor Changes
* `XMonad.Layout.Grid`
Fix as per issue #223; Grid will no longer calculate more columns than there
are windows.
* XMonad.Hooks.FadeWindows
Added support for GHC version 8.4.x by adding a Semigroup instance for

View File

@@ -56,7 +56,7 @@ arrange :: Double -> Rectangle -> [a] -> [(a, Rectangle)]
arrange aspectRatio (Rectangle rx ry rw rh) st = zip st rectangles
where
nwins = length st
ncols = max 1 . round . sqrt $ fromIntegral nwins * fromIntegral rw / (fromIntegral rh * aspectRatio)
ncols = max 1 . min nwins . round . sqrt $ fromIntegral nwins * fromIntegral rw / (fromIntegral rh * aspectRatio)
mincs = max 1 $ nwins `div` ncols
extrs = nwins - ncols * mincs
chop :: Int -> Dimension -> [(Position, Dimension)]