From ed8adcd4c482742919e9025f22a1060ae2e7019a Mon Sep 17 00:00:00 2001 From: Vincent Bernat Date: Wed, 18 Jul 2012 18:41:50 +0200 Subject: [PATCH] bindings: fix toggle_window() function There was a potential infinite loop because we didn't walk the stack correctly. --- rc/bindings.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/rc/bindings.lua b/rc/bindings.lua index 24d6dbc..7e722e6 100644 --- a/rc/bindings.lua +++ b/rc/bindings.lua @@ -58,12 +58,13 @@ local function toggle_window(filter) local cl, t = unpack(undo[i]) -- We only handle visible clients that are attached to the -- appropriate tag. Otherwise, we try the next one. - if cl and cl:isvisible() and + if cl and cl:isvisible() and t.selected and awful.util.table.hasitem(cl:tags(), t) then awful.client.toggletag(t, cl) table.remove(undo, i) return end + i = i - 1 end -- Clean up... while #undo > 10 do