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
|
end
|
||||||
|
|
||||||
capi.screen.connect_signal("removed", function(s)
|
capi.screen.connect_signal("removed", function(s)
|
||||||
|
local wibars = {}
|
||||||
for _, wibar in ipairs(wiboxes) do
|
for _, wibar in ipairs(wiboxes) do
|
||||||
if wibar._screen == s then
|
if wibar._screen == s then
|
||||||
wibar:remove()
|
table.insert(wibars, wibar)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
for _, wibar in ipairs(wibars) do
|
||||||
|
wibar:remove()
|
||||||
|
end
|
||||||
end)
|
end)
|
||||||
|
|
||||||
function awfulwibar.mt:__call(...)
|
function awfulwibar.mt:__call(...)
|
||||||
|
|
Loading…
Reference in New Issue