tests: Add the struts to the shims

This commit is contained in:
Emmanuel Lepage Vallee 2019-07-18 00:20:58 -04:00
parent 44e6b2d24e
commit 4eda67ce54
3 changed files with 20 additions and 2 deletions

View File

@ -151,6 +151,14 @@ function client.gen_fake(args)
return ret.data._struts
end
function ret:struts(new)
for k, v in pairs(new or {}) do
ret.data._struts[k] = v
end
return ret.data._struts
end
-- Record the geometry
ret._old_geo = {}
push_geometry(ret)

View File

@ -35,11 +35,20 @@ local function new_drawin(_, args)
ret.data.drawable.surface = cairo.ImageSurface(cairo.Format.ARGB32, 0, 0)
ret.data.drawable.geometry = ret.geometry
ret.data.drawable.refresh = function() end
ret.data._struts = { top = 0, right = 0, left = 0, bottom = 0 }
for _, k in pairs{ "buttons", "struts", "get_xproperty", "set_xproperty" } do
for _, k in pairs{ "buttons", "get_xproperty", "set_xproperty" } do
ret[k] = function() end
end
function ret:struts(new)
for k, v in pairs(new or {}) do
ret.data._struts[k] = v
end
return ret.data._struts
end
local md = setmetatable(ret, {
__index = function(...) return meta.__index(...) end,
__newindex = function(...) return meta.__newindex(...) end

View File

@ -1,4 +1,5 @@
local gears_obj = require("gears.object")
local gears_tab = require("gears.table")
local screen, meta = awesome._shim_fake_class()
screen._count, screen._deleted = 0, {}
@ -19,7 +20,7 @@ local function create_screen(args)
}
function s._resize(args2)
local old = s.geometry
local old = gears_tab.clone(s.geometry)
geo.x = args2.x or geo.x
geo.y = args2.y or geo.y
geo.width = args2.width or geo.width