From 25ac8795693137dda92e5446b6cbcf549a6fcefe Mon Sep 17 00:00:00 2001 From: Gwenhael Le Moine Date: Tue, 16 Dec 2008 18:27:52 +0700 Subject: [PATCH] suit.fair: restored C version fair layout's behaviour Signed-off-by: Gwenhael Le Moine Signed-off-by: Julien Danjou --- lib/awful/layout/suit/fair.lua.in | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/awful/layout/suit/fair.lua.in b/lib/awful/layout/suit/fair.lua.in index 9b078e60..c925f102 100644 --- a/lib/awful/layout/suit/fair.lua.in +++ b/lib/awful/layout/suit/fair.lua.in @@ -22,14 +22,15 @@ local function fair(screen, orientation) local cls = client.tiled(screen) if #cls > 0 then - local cells = math.floor(math.sqrt(#cls)) + local cells = math.ceil(math.sqrt(#cls)) local strips = math.ceil(#cls / cells) local cell = 0 local strip = 0 for k, c in ipairs(cls) do local g = {} - if orientation == "east" then + if ( orientation == "east" and #cls > 2 ) + or ( orientation == "south" and #cls <= 2 ) then if #cls < (strips * cells) and strip == strips - 1 then g.width = wa.width / (cells - ((strips * cells) - #cls)) else