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.
This commit is contained in:
parent
d494b87fb7
commit
e1aacfaa22
|
@ -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(...)
|
||||
|
|
Loading…
Reference in New Issue