layouts: let client sizing honor the border width

Signed-off-by: Gregor Best <gbe@ring0.de>
Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
Gregor Best 2010-05-28 19:43:46 +02:00 committed by Julien Danjou
parent 61430f860d
commit 752f0225d2
5 changed files with 33 additions and 7 deletions

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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)