From e1aacfaa22b6c20c4591bf690e831bb93abd9cda Mon Sep 17 00:00:00 2001 From: Kevin Zander Date: Thu, 2 Feb 2017 15:42:20 -0600 Subject: [PATCH] awful.wibar: move wibar:remove() call outside of loop over all wiboxes (#1501) Removing a wibar mid-loop will corrupt the indexing of the for loop and can cause other wibars from being removed. --- lib/awful/wibar.lua | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/awful/wibar.lua b/lib/awful/wibar.lua index 3ed9f0fa..9170d14a 100644 --- a/lib/awful/wibar.lua +++ b/lib/awful/wibar.lua @@ -359,11 +359,15 @@ function awfulwibar.new(arg) end capi.screen.connect_signal("removed", function(s) + local wibars = {} for _, wibar in ipairs(wiboxes) do if wibar._screen == s then - wibar:remove() + table.insert(wibars, wibar) end end + for _, wibar in ipairs(wibars) do + wibar:remove() + end end) function awfulwibar.mt:__call(...)