From e5a84e2fdabfc863f6ecb572a14128319fd74e52 Mon Sep 17 00:00:00 2001 From: Emmanuel Lepage Vallee Date: Sat, 21 Mar 2020 20:17:46 -0400 Subject: [PATCH] shims: Prevent signals when setting the client geo to the same value. --- tests/examples/shims/client.lua | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/tests/examples/shims/client.lua b/tests/examples/shims/client.lua index 6ed7a1c41..2a481864f 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