tests: Add the struts to the shims
This commit is contained in:
parent
44e6b2d24e
commit
4eda67ce54
|
@ -151,6 +151,14 @@ function client.gen_fake(args)
|
||||||
return ret.data._struts
|
return ret.data._struts
|
||||||
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
|
||||||
|
|
||||||
-- Record the geometry
|
-- Record the geometry
|
||||||
ret._old_geo = {}
|
ret._old_geo = {}
|
||||||
push_geometry(ret)
|
push_geometry(ret)
|
||||||
|
|
|
@ -35,11 +35,20 @@ local function new_drawin(_, args)
|
||||||
ret.data.drawable.surface = cairo.ImageSurface(cairo.Format.ARGB32, 0, 0)
|
ret.data.drawable.surface = cairo.ImageSurface(cairo.Format.ARGB32, 0, 0)
|
||||||
ret.data.drawable.geometry = ret.geometry
|
ret.data.drawable.geometry = ret.geometry
|
||||||
ret.data.drawable.refresh = function() end
|
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
|
ret[k] = function() end
|
||||||
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, {
|
local md = setmetatable(ret, {
|
||||||
__index = function(...) return meta.__index(...) end,
|
__index = function(...) return meta.__index(...) end,
|
||||||
__newindex = function(...) return meta.__newindex(...) end
|
__newindex = function(...) return meta.__newindex(...) end
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
local gears_obj = require("gears.object")
|
local gears_obj = require("gears.object")
|
||||||
|
local gears_tab = require("gears.table")
|
||||||
|
|
||||||
local screen, meta = awesome._shim_fake_class()
|
local screen, meta = awesome._shim_fake_class()
|
||||||
screen._count, screen._deleted = 0, {}
|
screen._count, screen._deleted = 0, {}
|
||||||
|
@ -19,7 +20,7 @@ local function create_screen(args)
|
||||||
}
|
}
|
||||||
|
|
||||||
function s._resize(args2)
|
function s._resize(args2)
|
||||||
local old = s.geometry
|
local old = gears_tab.clone(s.geometry)
|
||||||
geo.x = args2.x or geo.x
|
geo.x = args2.x or geo.x
|
||||||
geo.y = args2.y or geo.y
|
geo.y = args2.y or geo.y
|
||||||
geo.width = args2.width or geo.width
|
geo.width = args2.width or geo.width
|
||||||
|
|
Loading…
Reference in New Issue