awful.hooks.timer: 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
dd2c62721c
commit
bc1a2f5448
|
@ -54,7 +54,7 @@ for name, hook in pairs(capi.hooks) do
|
|||
_M[name] = {}
|
||||
if name == 'timer' then
|
||||
_M[name].register = function (time, f, runnow)
|
||||
if type(time) ~= 'number' or type(f) ~= 'function' or time <= 0 then
|
||||
if type(time) ~= 'number' or type(f) ~= 'function' or time < 0 then
|
||||
return
|
||||
end
|
||||
local new_timer
|
||||
|
@ -94,6 +94,12 @@ for name, hook in pairs(capi.hooks) do
|
|||
break
|
||||
end
|
||||
end
|
||||
local delays = { }
|
||||
for k, h in ipairs(_M[name].callbacks) do
|
||||
table.insert(delays, h.timer)
|
||||
end
|
||||
table.sort(delays)
|
||||
hook(delays[1])
|
||||
end
|
||||
end
|
||||
elseif name == "dbus" then
|
||||
|
|
Loading…
Reference in New Issue