ewmh.lua: Account for the border-width

Previously we were not taking into account the border-width of the
client which we ought to as otherwise the client goes of the screen by
several pixels. It's slightly more ugly when we have several screens
connected.

Signed-off-by: Uli Schlachter <psychon@znc.in>
This commit is contained in:
Ignas Anikevicius (gns_ank) 2012-03-01 23:06:39 +00:00 committed by Uli Schlachter
parent e37efaeb8a
commit 524a0c1b35
1 changed files with 4 additions and 2 deletions

View File

@ -29,7 +29,8 @@ local function maximized_horizontal(window, set)
if set then if set then
store_geometry(window, "maximized_horizontal") store_geometry(window, "maximized_horizontal")
local g = screen[window.screen].workarea local g = screen[window.screen].workarea
window:geometry { width = g.width, x = g.x } local bw = window.border_width or 0
window:geometry { width = g.width - 2*bw, x = g.x }
elseif data[window] and data[window].maximized_horizontal elseif data[window] and data[window].maximized_horizontal
and data[window].maximized_horizontal.x and data[window].maximized_horizontal.x
and data[window].maximized_horizontal.width then and data[window].maximized_horizontal.width then
@ -45,7 +46,8 @@ local function maximized_vertical(window, set)
if set then if set then
store_geometry(window, "maximized_vertical") store_geometry(window, "maximized_vertical")
local g = screen[window.screen].workarea local g = screen[window.screen].workarea
window:geometry { height = g.height, y = g.y } local bw = window.border_width or 0
window:geometry { height = g.height - 2*bw, y = g.y }
elseif data[window] and data[window].maximized_vertical elseif data[window] and data[window].maximized_vertical
and data[window].maximized_vertical.y and data[window].maximized_vertical.y
and data[window].maximized_vertical.height then and data[window].maximized_vertical.height then