shims: Send the property:: signal for the client class.
This commit is contained in:
parent
56256d0c38
commit
fd8401a399
|
@ -288,10 +288,14 @@ function client.gen_fake(args)
|
||||||
ret.drawable = ret
|
ret.drawable = ret
|
||||||
|
|
||||||
-- Make sure the layer properties are not `nil`
|
-- Make sure the layer properties are not `nil`
|
||||||
ret.ontop = false
|
local defaults = {
|
||||||
ret.below = false
|
ontop = false,
|
||||||
ret.above = false
|
below = false,
|
||||||
ret.sticky = false
|
above = false,
|
||||||
|
sticky = false,
|
||||||
|
urgent = false,
|
||||||
|
focusable = true,
|
||||||
|
}
|
||||||
|
|
||||||
-- Declare the deprecated buttons and keys methods.
|
-- Declare the deprecated buttons and keys methods.
|
||||||
function ret:_keys(new)
|
function ret:_keys(new)
|
||||||
|
@ -319,6 +323,8 @@ function client.gen_fake(args)
|
||||||
__index = function(self, key)
|
__index = function(self, key)
|
||||||
if properties["get_"..key] then
|
if properties["get_"..key] then
|
||||||
return properties["get_"..key](self)
|
return properties["get_"..key](self)
|
||||||
|
elseif defaults[key] ~= nil then
|
||||||
|
return defaults[key]
|
||||||
end
|
end
|
||||||
|
|
||||||
return meta.__index(self, key)
|
return meta.__index(self, key)
|
||||||
|
@ -329,7 +335,14 @@ function client.gen_fake(args)
|
||||||
return properties["set_"..key](self, value)
|
return properties["set_"..key](self, value)
|
||||||
end
|
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
|
end
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue