From 752f0225d2a731958872d899bbd715be2ec6adeb Mon Sep 17 00:00:00 2001 From: Gregor Best Date: Fri, 28 May 2010 19:43:46 +0200 Subject: [PATCH] layouts: let client sizing honor the border width Signed-off-by: Gregor Best Signed-off-by: Julien Danjou --- lib/awful/layout/suit/fair.lua.in | 3 ++- lib/awful/layout/suit/magnifier.lua.in | 17 +++++++++++++++-- lib/awful/layout/suit/max.lua.in | 8 +++++++- lib/awful/layout/suit/spiral.lua.in | 8 +++++++- lib/awful/layout/suit/tile.lua.in | 4 ++-- 5 files changed, 33 insertions(+), 7 deletions(-) diff --git a/lib/awful/layout/suit/fair.lua.in b/lib/awful/layout/suit/fair.lua.in index 24f92932b..e8bc9a8b9 100644 --- a/lib/awful/layout/suit/fair.lua.in +++ b/lib/awful/layout/suit/fair.lua.in @@ -34,7 +34,6 @@ local function fair(p, orientation) g.x = wa.x + cell * g.width g.y = wa.y + strip * g.height - else if #cls < (strips * cells) and strip == strips - 1 then g.height = wa.height / (cells - ((strips * cells) - #cls)) @@ -47,6 +46,8 @@ local function fair(p, orientation) g.y = wa.y + cell * g.height end + g.width = g.width - c.border_width * 2 + g.height = g.height - c.border_width * 2 c:geometry(g) cell = cell + 1 diff --git a/lib/awful/layout/suit/magnifier.lua.in b/lib/awful/layout/suit/magnifier.lua.in index 2d4a52675..e0909241a 100644 --- a/lib/awful/layout/suit/magnifier.lua.in +++ b/lib/awful/layout/suit/magnifier.lua.in @@ -55,7 +55,14 @@ function arrange(p) geometry.width = area.width geometry.height = area.height end - focus:geometry(geometry) + + local g = { + x = geometry.x, + y = geometry.y, + width = geometry.width - focus.border_width * 2, + height = geometry.height - focus.border_width * 2 + } + focus:geometry(g) focus:raise() if #cls > 1 then @@ -83,7 +90,13 @@ function arrange(p) -- Then move clients that are after focused client. -- So the next focused window will be the one at the top of the screen. for k = 1, fidx - 1 do - cls[k]:geometry(geometry) + local g = { + x = geometry.x, + y = geometry.y, + width = geometry.width - cls[k].border_width * 2, + height = geometry.height - cls[k].border_width * 2 + } + cls[k]:geometry(g) geometry.y = geometry.y + geometry.height end end diff --git a/lib/awful/layout/suit/max.lua.in b/lib/awful/layout/suit/max.lua.in index cec074991..ded195c9f 100644 --- a/lib/awful/layout/suit/max.lua.in +++ b/lib/awful/layout/suit/max.lua.in @@ -21,7 +21,13 @@ local function fmax(p, fs) end for k, c in pairs(p.clients) do - c:geometry(area) + local g = { + x = area.x, + y = area.y, + width = area.width - c.border_width * 2, + height = area.height - c.border_width * 2 + } + c:geometry(g) end end diff --git a/lib/awful/layout/suit/spiral.lua.in b/lib/awful/layout/suit/spiral.lua.in index 6a52d14c1..6695b4a1d 100644 --- a/lib/awful/layout/suit/spiral.lua.in +++ b/lib/awful/layout/suit/spiral.lua.in @@ -38,7 +38,13 @@ local function spiral(p, spiral) wa.y = wa.y + wa.height end - c:geometry(wa) + local g = { + x = wa.x, + y = wa.y, + width = wa.width - 2 * c.border_width, + height = wa.height - 2 * c.border_width + } + c:geometry(g) end end diff --git a/lib/awful/layout/suit/tile.lua.in b/lib/awful/layout/suit/tile.lua.in index acd66ebaf..12625ae7b 100644 --- a/lib/awful/layout/suit/tile.lua.in +++ b/lib/awful/layout/suit/tile.lua.in @@ -58,8 +58,8 @@ local function tile_group(cls, wa, orientation, fact, group) local unused = wa[height] for c = group.first,group.last do local i = c - group.first +1 - geom[width] = size - geom[height] = math.floor(unused * fact[i] / total_fact) + geom[width] = size - cls[c].border_width * 2 + geom[height] = math.floor(unused * fact[i] / total_fact) - cls[c].border_width * 2 geom[x] = group.coord geom[y] = coord geom = cls[c]:geometry(geom)