diff --git a/lib/awful/layout/suit/spiral.lua.in b/lib/awful/layout/suit/spiral.lua.in index aea42f39d..626d9f238 100644 --- a/lib/awful/layout/suit/spiral.lua.in +++ b/lib/awful/layout/suit/spiral.lua.in @@ -21,40 +21,37 @@ local function spiral(p, dwindle) local nh = wa.height for k, c in ipairs(cls) do - if (k % 2 == 0 and nh / 2 > 2 * c.border_width) - or (k % 2 == 1 and nw / 2 > 2 * c.border_width) then - if k < n then - if k % 2 == 0 then - nh = nh / 2 - else - nw = nw / 2 - end - if k % 4 == 3 and not dwindle then - nx = nx + nw - elseif k % 4 == 0 and not dwindle then - ny = ny + nh - end + if k < n then + if k % 2 == 0 then + nh = nh / 2 + else + nw = nw / 2 end - if k % 4 == 1 then - if dwindle then - ny = ny + nh - else - ny = ny - nh - end - elseif k % 4 == 2 then + if k % 4 == 3 and not dwindle then nx = nx + nw - elseif k % 4 == 3 then + elseif k % 4 == 0 and not dwindle then ny = ny + nh - elseif k % 4 == 0 then - if dwindle then - nx = nx + nw - else - nx = nx - nw - end end - if k == 1 then - ny = wa.y + end + if k % 4 == 1 then + if dwindle then + ny = ny + nh + else + ny = ny - nh end + elseif k % 4 == 2 then + nx = nx + nw + elseif k % 4 == 3 then + ny = ny + nh + elseif k % 4 == 0 then + if dwindle then + nx = nx + nw + else + nx = nx - nw + end + end + if k == 1 then + ny = wa.y end local geom = { x = nx, y = ny, width = nw, height = nh } c:geometry(geom)