Signed-off-by: Gwenhael Le Moine <[email protected]>
---
 lib/awful/layout/suit/fair.lua.in |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/lib/awful/layout/suit/fair.lua.in 
b/lib/awful/layout/suit/fair.lua.in
index 9b078e6..c925f10 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
-- 
1.6.0.3
>From 332b9d77752fbfb617dac082aaa7778648cae730 Mon Sep 17 00:00:00 2001
From: Gwenhael Le Moine <[email protected]>
Date: Tue, 16 Dec 2008 18:27:52 +0700
Subject: [PATCH] restored C version fair layout's behaviour

Signed-off-by: Gwenhael Le Moine <[email protected]>
---
 lib/awful/layout/suit/fair.lua.in |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/lib/awful/layout/suit/fair.lua.in b/lib/awful/layout/suit/fair.lua.in
index 9b078e6..c925f10 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
-- 
1.6.0.3

Reply via email to