awful.widget: Use private args for the update_function.

Previously, it would use the "real" args passed to the constructor.

It was a bad decision since:

 * It doesn't allow the tag/tasklist to add properties internally
 * It forces the widget to be created with a constructor rather than
   the alternate declarative syntax
 * It doesn't allow a tag/tasklist to be part of a widget_template

Technically this is a behavior change, but I doubt anybody will notice
given it is a dark and little documented corner of the API. Chances are
nobody have been using this API for years.
This commit is contained in:
Emmanuel Lepage Vallee 2019-03-06 22:44:02 -05:00
parent d5a2fe0072
commit e452ec8e27
2 changed files with 6 additions and 2 deletions

View file

@ -400,7 +400,9 @@ local function taglist_update(s, w, buttons, filter, data, style, update_functio
local function label(c) return taglist.taglist_label(c, style) end
update_function(w, buttons, label, data, tags, args)
update_function(w, buttons, label, data, tags, {
widget_template = args.widget_template,
})
end
--- Create a new taglist widget. The last two arguments (update_function

View file

@ -417,7 +417,9 @@ local function tasklist_update(s, w, buttons, filter, data, style, update_functi
local function label(c, tb) return tasklist_label(c, style, tb) end
update_function(w, buttons, label, data, clients, args)
update_function(w, buttons, label, data, clients, {
widget_template = args.widget_template,
})
end
--- Create a new tasklist widget.