tasklist: Unreference client in unmanage

Signed-off-by: Uli Schlachter <psychon@znc.in>
This commit is contained in:
Uli Schlachter 2016-01-24 16:28:07 +01:00
parent 69d96ba34d
commit 7d32f7b733
1 changed files with 11 additions and 1 deletions

View File

@ -181,6 +181,9 @@ function tasklist.new(screen, filter, buttons, style, update_function, base_widg
queued_update = true
end
end
function w._unmanage(c)
data[c] = nil
end
if instances == nil then
instances = {}
local function us(s)
@ -219,7 +222,14 @@ function tasklist.new(screen, filter, buttons, style, update_function, base_widg
capi.client.connect_signal("property::hidden", u)
capi.client.connect_signal("tagged", u)
capi.client.connect_signal("untagged", u)
capi.client.connect_signal("unmanage", u)
capi.client.connect_signal("unmanage", function(c)
u(c)
for s, i in pairs(instances) do
for _, tlist in pairs(i) do
tlist._unmanage(c)
end
end
end)
capi.client.connect_signal("list", u)
capi.client.connect_signal("focus", u)
capi.client.connect_signal("unfocus", u)