diff --git a/lib/naughty/layout/box.lua b/lib/naughty/layout/box.lua index 90b0c45a..3d8feb4a 100644 --- a/lib/naughty/layout/box.lua +++ b/lib/naughty/layout/box.lua @@ -274,15 +274,15 @@ local function new(args) border_color = args.border_color or beautiful.notification_border_color, } + -- The C code needs `pairs` to work, so a full copy is required. + gtable.crush(new_args, args, true) + -- Add a weak-table layer for the screen. local weak_args = setmetatable({ screen = args.notification and args.notification.screen or nil - }, {__index = args, __mode = "v"}) + }, {__mode="v"}) - -- This will cascade from the overriden `new_args` to the weak `weak_args` - -- to the original arguments. This way the original wont be modified and - -- the screen wont leak. - new_args = setmetatable(new_args, {__index = weak_args}) + setmetatable(new_args, {__index = weak_args}) -- Generate the box before the popup is created to avoid the size changing new_args.widget = generate_widget(new_args, new_args.notification) @@ -316,6 +316,8 @@ local function new(args) abutton({ }, 3, hide) )) + gtable.crush(ret, box, false) + return ret end