From 4a845ced0fab4cca6f3122149756953a296b8667 Mon Sep 17 00:00:00 2001 From: Daniel Hahler Date: Fri, 10 Jul 2015 13:35:46 +0200 Subject: [PATCH] awful.widget.graph: setters: emit widget::updated only on changes Ref: #284 --- lib/awful/widget/graph.lua | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/awful/widget/graph.lua b/lib/awful/widget/graph.lua index be958724..abe464fb 100644 --- a/lib/awful/widget/graph.lua +++ b/lib/awful/widget/graph.lua @@ -224,8 +224,10 @@ end for _, prop in ipairs(properties) do if not graph["set_" .. prop] then graph["set_" .. prop] = function(_graph, value) - data[_graph][prop] = value - _graph:emit_signal("widget::updated") + if data[_graph][prop] ~= value then + data[_graph][prop] = value + _graph:emit_signal("widget::updated") + end return _graph end end