diff --git a/tests/examples/shims/client.lua b/tests/examples/shims/client.lua index 6ed7a1c4..2a481864 100644 --- a/tests/examples/shims/client.lua +++ b/tests/examples/shims/client.lua @@ -1,4 +1,5 @@ local gears_obj = require("gears.object") +local grect = require("gears.geometry").rectangle local clients = {} @@ -98,7 +99,14 @@ function client.gen_fake(args) -- Emulate capi.client.geometry function ret:geometry(new) - if new then + local new_full = new and { + x = new.x or ret.x, + y = new.y or ret.y, + width = new.width or ret.width, + height = new.height or ret.height, + } or nil + + if new and not grect.are_equal(ret, new_full) then for k,v in pairs(new) do ret[k] = v ret:emit_signal("property::"..k, v) @@ -130,6 +138,12 @@ function client.gen_fake(args) ret._old_geo[#ret._old_geo]._hide = true end + function ret:_hide_all() + for _, geo in ipairs(ret._old_geo) do + geo._hide = true + end + end + function ret:get_xproperty() return nil end