bindings: remove a window from the "undo" stack when it becomes unmanaged

This commit is contained in:
Vincent Bernat 2012-10-22 16:32:54 +02:00
parent e9304f8668
commit f226acf2d3

View file

@ -23,6 +23,15 @@ end
-- function that will effectively toggle things. -- function that will effectively toggle things.
local function toggle_window(filter) local function toggle_window(filter)
local undo = {} -- undo stack 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() local toggle = function()
-- "Current" screen -- "Current" screen
local s = client.focus and client.focus.screen or mouse.screen local s = client.focus and client.focus.screen or mouse.screen