awful.widget.taglist: use attached_add_signal

Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
Julien Danjou 2009-08-18 16:50:01 +02:00
parent c66be3aa82
commit 1692496fce
1 changed files with 5 additions and 13 deletions

View File

@ -66,23 +66,15 @@ function new(screen, label, buttons)
local uc = function (c) return u(c.screen) end local uc = function (c) return u(c.screen) end
capi.client.add_signal("focus", uc) capi.client.add_signal("focus", uc)
capi.client.add_signal("unfocus", uc) capi.client.add_signal("unfocus", uc)
tag.attached_add_signal(screen, "property::selected", uc)
tag.attached_add_signal(screen, "property::icon", uc)
tag.attached_add_signal(screen, "property::hide", uc)
capi.screen[screen]:add_signal("tag::attach", function(screen, tag) capi.screen[screen]:add_signal("tag::attach", function(screen, tag)
taglist_update(s, w, label, buttons, data, widgets) u(screen.index)
tag:add_signal("property::selected", uc)
tag:add_signal("property::icon", uc)
tag:add_signal("property::hide", uc)
end) end)
capi.screen[screen]:add_signal("tag::detach", function(screen, tag) capi.screen[screen]:add_signal("tag::detach", function(screen, tag)
taglist_update(s, w, label, buttons, data, widgets) u(screen.index)
tag:remove_signal("property::selected", uc)
tag:remove_signal("property::icon", uc)
tag:remove_signal("property::hide", uc)
end) end)
for _, tag in ipairs(capi.screen[screen]:tags()) do
tag:add_signal("property::selected", uc)
tag:add_signal("property::icon", uc)
tag:add_signal("property::hide", uc)
end
capi.client.add_signal("new", function(c) capi.client.add_signal("new", function(c)
c:add_signal("property::urgent", uc) c:add_signal("property::urgent", uc)
c:add_signal("property::screen", function(c) c:add_signal("property::screen", function(c)