fix: uncalled for autohide timer triggering on init

This commit is contained in:
tomasklaen
2023-04-10 22:24:13 +02:00
parent e1b663f930
commit a0b18eabec
2 changed files with 5 additions and 4 deletions

View File

@@ -337,9 +337,11 @@ cursor = {
autohide = function()
if not cursor.on_primary_up and not Menu:is_open() then handle_mouse_leave() end
end,
autohide_timer = mp.add_timeout(mp.get_property_native('cursor-autohide') / 1000, function()
cursor.autohide()
end),
autohide_timer = (function()
local timer = mp.add_timeout(mp.get_property_native('cursor-autohide') / 1000, function() cursor.autohide() end)
timer:kill()
return timer
end)(),
queue_autohide = function()
if options.autohide and not cursor.on_primary_up then
cursor.autohide_timer:kill()

View File

@@ -108,7 +108,6 @@ end
-- Disabled elements don't receive these events.
---@param name string Event name.
function Elements:proximity_trigger(name, ...)
local stop_normal, stop_global = false, false
for i = #self.itable, 1, -1 do
local element = self.itable[i]
if element.enabled then