diff --git a/CHANGES.md b/CHANGES.md index dd5dc0a2..cf736fd5 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -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 diff --git a/XMonad/Layout/Grid.hs b/XMonad/Layout/Grid.hs index 845fa80e..769a6c63 100644 --- a/XMonad/Layout/Grid.hs +++ b/XMonad/Layout/Grid.hs @@ -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)]