From 9630f3c3edc0ea63502db501c569f92181db2e2b Mon Sep 17 00:00:00 2001 From: Emmanuel Lepage Vallee Date: Thu, 26 May 2016 14:37:58 -0400 Subject: [PATCH] widget: Move the identifier index into _private --- lib/wibox/widget/base.lua | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/lib/wibox/widget/base.lua b/lib/wibox/widget/base.lua index ccf960dd..54a04cb9 100644 --- a/lib/wibox/widget/base.lua +++ b/lib/wibox/widget/base.lua @@ -494,7 +494,13 @@ function base.widget:setup(args) -- Avoid being dropped by wibox metatable -> drawin rawset(self, id, w) end - rawset(self, "_by_id", ids) + + if rawget(self, "_private") then + self._private.by_id = ids + else + rawset(self, "_by_id", ids) + end + rawset(self, "get_children_by_id", get_children_by_id) end @@ -514,7 +520,13 @@ function base.make_widget_declarative(args) local mt = getmetatable(w) or {} local orig_string = tostring(w) - rawset(w, "_by_id", ids) + + if rawget(w, "_private") then + w._private.by_id = ids + else + rawset(w, "_by_id", ids) + end + rawset(w, "get_children_by_id", get_children_by_id) mt.__tostring = function()