awful: ewmh.lua Fix unmaximization (#964)

This makes awful not to overwrite the saved geometry by just storing the
two geometries in separate places.

Signed-off-by: Uli Schlachter <psychon@znc.in>
This commit is contained in:
Ignas Anikevicius (gns_ank) 2012-03-01 03:46:48 +00:00 committed by Uli Schlachter
parent 1e4bf83d3b
commit e37efaeb8a
1 changed files with 12 additions and 12 deletions

View File

@ -27,14 +27,14 @@ end
-- @param set Set or unset the maximized values. -- @param set Set or unset the maximized values.
local function maximized_horizontal(window, set) local function maximized_horizontal(window, set)
if set then if set then
store_geometry(window, "maximized") 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 } window:geometry { width = g.width, x = g.x }
elseif data[window] and data[window].maximized elseif data[window] and data[window].maximized_horizontal
and data[window].maximized.x and data[window].maximized_horizontal.x
and data[window].maximized.width then and data[window].maximized_horizontal.width then
window:geometry { width = data[window].maximized.width, local g = data[window].maximized_horizontal
x = data[window].maximized.x } window:geometry { width = g.width, x = g.x }
end end
end end
@ -43,14 +43,14 @@ end
-- @param set Set or unset the maximized values. -- @param set Set or unset the maximized values.
local function maximized_vertical(window, set) local function maximized_vertical(window, set)
if set then if set then
store_geometry(window, "maximized") 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 } window:geometry { height = g.height, y = g.y }
elseif data[window] and data[window].maximized elseif data[window] and data[window].maximized_vertical
and data[window].maximized.y and data[window].maximized_vertical.y
and data[window].maximized.height then and data[window].maximized_vertical.height then
window:geometry { height = data[window].maximized.height, local g = data[window].maximized_vertical
y = data[window].maximized.y } window:geometry { height = g.height, y = g.y }
end end
end end