From 00d249a351818ce237c4da917f8e80be0fd1d028 Mon Sep 17 00:00:00 2001 From: christoph-heinrich Date: Fri, 28 Oct 2022 09:46:21 +0200 Subject: [PATCH] fix: selection on mbtn_up requires mbtn_down first (#348) Without checking if mbtn_down happened first in the menu, it is possible to select an item right after opening the menu from the controls. (mbtn_down on control opens menu, mbtn_up selects item in menu) --- scripts/uosc_shared/elements/Menu.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/uosc_shared/elements/Menu.lua b/scripts/uosc_shared/elements/Menu.lua index f975591..62b343d 100644 --- a/scripts/uosc_shared/elements/Menu.lua +++ b/scripts/uosc_shared/elements/Menu.lua @@ -498,7 +498,7 @@ function Menu:fling_distance() end function Menu:on_global_mbtn_left_up() - if self.proximity_raw == 0 and not self.is_dragging then + if self.proximity_raw == 0 and self.drag_data and not self.is_dragging then self:select_item_below_cursor() self:open_selected_item({preselect_submenu_item = false}) end