From bd885f59f52c2c97b4f796ab1f4f56a35924da90 Mon Sep 17 00:00:00 2001 From: Daniel Hahler Date: Tue, 7 Jul 2015 13:01:53 +0200 Subject: [PATCH] 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. --- lib/awful/client.lua | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/lib/awful/client.lua b/lib/awful/client.lua index 52eab6a7..fe7d1112 100644 --- a/lib/awful/client.lua +++ b/lib/awful/client.lua @@ -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).