From 26e2e2f3754e67aeef211a290b583b0d1a1bb3f5 Mon Sep 17 00:00:00 2001 From: Julien Danjou Date: Tue, 18 Aug 2009 16:46:30 +0200 Subject: [PATCH] awful.layout: use attached_add_signal Signed-off-by: Julien Danjou --- lib/awful/layout/init.lua.in | 21 +++++++-------------- 1 file changed, 7 insertions(+), 14 deletions(-) diff --git a/lib/awful/layout/init.lua.in b/lib/awful/layout/init.lua.in index 973926cbd..d30d7feeb 100644 --- a/lib/awful/layout/init.lua.in +++ b/lib/awful/layout/init.lua.in @@ -116,28 +116,21 @@ local function arrange_on_tagged(c, tag) end for s = 1, capi.screen.count() do + tag.attached_add_signal(s, "property::mwfact", arrange_prop) + tag.attached_add_signal(s, "property::nmaster", arrange_prop) + tag.attached_add_signal(s, "property::ncol", arrange_prop) + tag.attached_add_signal(s, "property::layout", arrange_prop) + tag.attached_add_signal(s, "property::windowfact", arrange_prop) + tag.attached_add_signal(s, "property::selected", arrange_prop) + tag.attached_add_signal(s, "tagged", arrange_prop) capi.screen[s]:add_signal("property::workarea", function(screen) arrange(screen.index) end) capi.screen[s]:add_signal("tag::attach", function (screen, tag) arrange(screen.index) - tag:add_signal("property::mwfact", arrange_prop) - tag:add_signal("property::nmaster", arrange_prop) - tag:add_signal("property::ncol", arrange_prop) - tag:add_signal("property::layout", arrange_prop) - tag:add_signal("property::windowfact", arrange_prop) - tag:add_signal("property::selected", arrange_prop) - tag:add_signal("tagged", arrange_on_tagged) end) capi.screen[s]:add_signal("tag::detach", function (screen, tag) arrange(screen.index) - tag:remove_signal("property::mwfact", arrange_prop) - tag:remove_signal("property::nmaster", arrange_prop) - tag:remove_signal("property::ncol", arrange_prop) - tag:remove_signal("property::layout", arrange_prop) - tag:remove_signal("property::windowfact", arrange_prop) - tag:remove_signal("property::selected", arrange_prop) - tag:remove_signal("tagged", arrange_on_tagged) end) capi.screen[s]:add_signal("padding", arrange) end