From 1692496fce51a793352e98d94e420ca44c01b483 Mon Sep 17 00:00:00 2001 From: Julien Danjou Date: Tue, 18 Aug 2009 16:50:01 +0200 Subject: [PATCH] awful.widget.taglist: use attached_add_signal Signed-off-by: Julien Danjou --- lib/awful/widget/taglist.lua.in | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/lib/awful/widget/taglist.lua.in b/lib/awful/widget/taglist.lua.in index fd192777..f98d37cf 100644 --- a/lib/awful/widget/taglist.lua.in +++ b/lib/awful/widget/taglist.lua.in @@ -66,23 +66,15 @@ function new(screen, label, buttons) local uc = function (c) return u(c.screen) end capi.client.add_signal("focus", 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) - taglist_update(s, w, label, buttons, data, widgets) - tag:add_signal("property::selected", uc) - tag:add_signal("property::icon", uc) - tag:add_signal("property::hide", uc) + u(screen.index) end) capi.screen[screen]:add_signal("tag::detach", function(screen, tag) - taglist_update(s, w, label, buttons, data, widgets) - tag:remove_signal("property::selected", uc) - tag:remove_signal("property::icon", uc) - tag:remove_signal("property::hide", uc) + u(screen.index) 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) c:add_signal("property::urgent", uc) c:add_signal("property::screen", function(c)