From fd8401a39953c10cd342cd37a667cd76063d1a32 Mon Sep 17 00:00:00 2001 From: Emmanuel Lepage Vallee Date: Sat, 16 Oct 2021 18:29:38 -0700 Subject: [PATCH] shims: Send the property:: signal for the client class. --- tests/examples/shims/client.lua | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/tests/examples/shims/client.lua b/tests/examples/shims/client.lua index 33a22b77e..d3f69d7b0 100644 --- a/tests/examples/shims/client.lua +++ b/tests/examples/shims/client.lua @@ -288,10 +288,14 @@ function client.gen_fake(args) ret.drawable = ret -- Make sure the layer properties are not `nil` - ret.ontop = false - ret.below = false - ret.above = false - ret.sticky = false + local defaults = { + ontop = false, + below = false, + above = false, + sticky = false, + urgent = false, + focusable = true, + } -- Declare the deprecated buttons and keys methods. function ret:_keys(new) @@ -319,6 +323,8 @@ function client.gen_fake(args) __index = function(self, key) if properties["get_"..key] then return properties["get_"..key](self) + elseif defaults[key] ~= nil then + return defaults[key] end return meta.__index(self, key) @@ -329,7 +335,14 @@ function client.gen_fake(args) return properties["set_"..key](self, value) end - return meta.__newindex(self, key, value) + if defaults[key] ~= nil then + defaults[key] = value + else + meta.__newindex(self, key, value) + end + + ret:emit_signal("property::"..key, value) + --client.emit_signal("property::"..key, ret, value) end })