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
This commit is contained in:
Emmanuel Lepage Vallee 2016-07-30 17:12:20 -04:00
parent 128933c115
commit 41feec02a5
1 changed files with 7 additions and 0 deletions

View File

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