diff --git a/lib/awful/widget/layoutbox.lua b/lib/awful/widget/layoutbox.lua index cd5e04409..cb302067a 100644 --- a/lib/awful/widget/layoutbox.lua +++ b/lib/awful/widget/layoutbox.lua @@ -56,10 +56,10 @@ function layoutbox.new(screen) local w = boxes[screen] if not w then w = imagebox() - w._layoutbox_tooltip = tooltip({ objects = {w}, delay_show = 1 }) + w._layoutbox_tooltip = tooltip {objects = {w}, delay_show = 1} update(w, screen) - boxes[screen] = setmetatable({}, {__index = w, __newindex = w}) + boxes[screen] = w end return w diff --git a/tests/test-leaks.lua b/tests/test-leaks.lua index 247524fce..725ed169f 100644 --- a/tests/test-leaks.lua +++ b/tests/test-leaks.lua @@ -14,6 +14,7 @@ end -- Make the layoutbox in the default config GC'able -- luacheck: globals mywibox mylayoutbox for s in screen do + mywibox[s]:set_widget(wibox.widget.textbox()) mywibox[s].visible = false end mywibox = nil