From e452ec8e273262f182211cb2d400478e877095a5 Mon Sep 17 00:00:00 2001 From: Emmanuel Lepage Vallee Date: Wed, 6 Mar 2019 22:44:02 -0500 Subject: [PATCH] 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. --- lib/awful/widget/taglist.lua | 4 +++- lib/awful/widget/tasklist.lua | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/awful/widget/taglist.lua b/lib/awful/widget/taglist.lua index 80690bda..0fd08ab1 100644 --- a/lib/awful/widget/taglist.lua +++ b/lib/awful/widget/taglist.lua @@ -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 diff --git a/lib/awful/widget/tasklist.lua b/lib/awful/widget/tasklist.lua index 825e36b2..d1141aa3 100644 --- a/lib/awful/widget/tasklist.lua +++ b/lib/awful/widget/tasklist.lua @@ -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.