awful.tag: call property hooks on properties changes

Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
Julien Danjou 2009-05-18 16:39:38 +02:00
parent ca777201a7
commit ef2b18949c
2 changed files with 6 additions and 4 deletions

View File

@ -123,6 +123,12 @@ hooks.property.register(function (obj, prop)
or prop == "visible" then or prop == "visible" then
on_arrange(obj.screen) on_arrange(obj.screen)
end end
elseif objtype == "tag" then
if prop == "mwfact"
or prop == "nmaster"
or prop == "ncol" then
on_arrange(obj.screen)
end
end end
end) end)
hooks.wibox_position.register(function(wibox) hooks.wibox_position.register(function(wibox)

View File

@ -12,7 +12,6 @@ local table = table
local setmetatable = setmetatable local setmetatable = setmetatable
local capi = local capi =
{ {
hooks = hooks,
screen = screen, screen = screen,
mouse = mouse mouse = mouse
} }
@ -106,7 +105,6 @@ function setmwfact(mwfact, t)
local t = t or selected() local t = t or selected()
if mwfact >= 0 and mwfact <= 1 then if mwfact >= 0 and mwfact <= 1 then
setproperty(t, "mwfact", mwfact) setproperty(t, "mwfact", mwfact)
capi.hooks.arrange()(t.screen)
end end
end end
@ -130,7 +128,6 @@ function setnmaster(nmaster, t)
local t = t or selected() local t = t or selected()
if nmaster >= 0 then if nmaster >= 0 then
setproperty(t, "nmaster", nmaster) setproperty(t, "nmaster", nmaster)
capi.hooks.arrange()(t.screen)
end end
end end
@ -169,7 +166,6 @@ function setncol(ncol, t)
local t = t or selected() local t = t or selected()
if ncol >= 1 then if ncol >= 1 then
setproperty(t, "ncol", ncol) setproperty(t, "ncol", ncol)
capi.hooks.arrange()(t.screen)
end end
end end