Fix menu button closing the menu immediately after opening it

closes #77
This commit is contained in:
tomasklaen
2022-08-20 22:12:58 +02:00
parent 8a85070f27
commit 52baad25d0

View File

@@ -2588,7 +2588,12 @@ if itable_find({'center', 'bottom-bar'}, options.menu_button) then
on_display_change = function(this) this:update_dimensions() end,
on_prop_border = function(this) this:update_dimensions() end,
on_mbtn_left_down = function(this)
if this.proximity_raw == 0 then menu_key_binding() end
if this.proximity_raw == 0 then
-- We delay menu opening to next tick, otherwise it gets added at
-- the end of the elements list, and the mbtn_left_down event
-- dispatcher inside which we are now will tell it to close itself.
mp.add_timeout(0.01, menu_key_binding)
end
end,
render = render_menu_button,
}))