awful.widget.graph: setters: emit widget::updated only on changes

Ref: #284
This commit is contained in:
Daniel Hahler 2015-07-10 13:35:46 +02:00
parent 3be423fcb3
commit 4a845ced0f
1 changed files with 4 additions and 2 deletions

View File

@ -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