From 41feec02a5fede3cdb51cb9bd2be5c65ef82c0d7 Mon Sep 17 00:00:00 2001 From: Emmanuel Lepage Vallee Date: Sat, 30 Jul 2016 17:12:20 -0400 Subject: [PATCH] widget.base: Fix the root get_children_by_id() widget. If the wibox root widget had an id, it was added to the properties, but not the get_children_by_id() table --- lib/wibox/widget/base.lua | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lib/wibox/widget/base.lua b/lib/wibox/widget/base.lua index 07a72fb5b..2ed69066c 100644 --- a/lib/wibox/widget/base.lua +++ b/lib/wibox/widget/base.lua @@ -495,6 +495,8 @@ function base.widget:setup(args) if id then -- Avoid being dropped by wibox metatable -> drawin rawset(self, id, w) + ids[id] = ids[id] or {} + table.insert(ids[id], 1, w) end if rawget(self, "_private") then @@ -522,6 +524,11 @@ function base.make_widget_declarative(args) local mt = getmetatable(w) or {} local orig_string = tostring(w) + -- Add the main id (if any) + if id then + ids[id] = ids[id] or {} + table.insert(ids[id], 1, w) + end if rawget(w, "_private") then w._private.by_id = ids