awful.client.property.set: emit property:: signals only on change

Emit "propery::" signals and call `c:set_xproperty` only if the
properties new value has changed.
This commit is contained in:
Daniel Hahler 2015-07-07 13:01:53 +02:00
parent ae7c7ff382
commit bd885f59f5
1 changed files with 6 additions and 4 deletions

View File

@ -937,11 +937,13 @@ function client.property.set(c, prop, value)
if not client.data.properties[c] then
client.data.properties[c] = {}
end
if client.data.persistent_properties_registered[prop] then
c:set_xproperty("awful.client.property." .. prop, value)
if client.data.properties[c][prop] ~= value then
if client.data.persistent_properties_registered[prop] then
c:set_xproperty("awful.client.property." .. prop, value)
end
client.data.properties[c][prop] = value
c:emit_signal("property::" .. prop)
end
client.data.properties[c][prop] = value
c:emit_signal("property::" .. prop)
end
--- Set a client property to be persistent across restarts (via X properties).