awful.layout: use attached_add_signal

Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
Julien Danjou 2009-08-18 16:46:30 +02:00
parent d7a961175f
commit 26e2e2f375

View file

@ -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