From 5fecdc052d3b7664a0f02f099ab3f55d1c452c3c Mon Sep 17 00:00:00 2001 From: Julien Danjou Date: Thu, 27 Nov 2008 11:18:35 +0100 Subject: [PATCH] awful.client: fix iteration over removed elements Signed-off-by: Julien Danjou --- lib/awful/client.lua.in | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/awful/client.lua.in b/lib/awful/client.lua.in index c1480182..155633a7 100644 --- a/lib/awful/client.lua.in +++ b/lib/awful/client.lua.in @@ -198,12 +198,14 @@ function next(i, c) if sel then -- Get all visible clients local cls = visible(sel.screen) - -- Remove all no-normal clients + local fcls = {} + -- Remove all non-normal clients for idx, c in ipairs(cls) do - if not focus.filter(c) then - table.remove(cls, idx) + if focus.filter(c) then + table.insert(fcls, c) end end + cls = fcls -- Loop upon each client for idx, c in ipairs(cls) do if c == sel then