awful.hooks: finally and for the last time fix timer removal
Signed-off-by: Gregor Best <farhaven@googlemail.com> Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
parent
90241e4076
commit
ef6d6dd12c
|
@ -99,7 +99,16 @@ for name, hook in pairs(capi.hooks) do
|
||||||
table.insert(delays, h.timer)
|
table.insert(delays, h.timer)
|
||||||
end
|
end
|
||||||
table.sort(delays)
|
table.sort(delays)
|
||||||
hook(delays[1])
|
_M[name].timer = delays[1]
|
||||||
|
hook(delays[1], function (...)
|
||||||
|
for i, callback in ipairs(_M[name].callbacks) do
|
||||||
|
callback['counter'] = callback['counter'] + _M[name].timer
|
||||||
|
if callback['counter'] >= callback['timer'] then
|
||||||
|
callback['callback'](...)
|
||||||
|
callback['counter'] = 0
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
elseif name == "dbus" then
|
elseif name == "dbus" then
|
||||||
|
|
Loading…
Reference in New Issue