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()