From f226acf2d38af43939eaf09c8221638f382e3223 Mon Sep 17 00:00:00 2001 From: Vincent Bernat Date: Mon, 22 Oct 2012 16:32:54 +0200 Subject: [PATCH] bindings: remove a window from the "undo" stack when it becomes unmanaged --- rc/bindings.lua | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/rc/bindings.lua b/rc/bindings.lua index fd6fcb1..ab7ef6c 100644 --- a/rc/bindings.lua +++ b/rc/bindings.lua @@ -23,6 +23,15 @@ end -- function that will effectively toggle things. local function toggle_window(filter) local undo = {} -- undo stack + client.add_signal('unmanage', + function(c) + -- If the client is in the undo stack, remove it + while true do + idx = awful.util.table.hasitem(undo, c) + if not idx then break end + table.remove(undo, idx) + end + end) local toggle = function() -- "Current" screen local s = client.focus and client.focus.screen or mouse.screen