From cd5c64fe8c7a2aeb086a1d4440961a1fce21f096 Mon Sep 17 00:00:00 2001 From: takase1121 <20792268+takase1121@users.noreply.github.com> Date: Sat, 5 Jun 2021 08:51:17 +0800 Subject: [PATCH] prevent mouse movement from propagating when context menu is open --- data/plugins/contextmenu.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/data/plugins/contextmenu.lua b/data/plugins/contextmenu.lua index 19ed585..6a14d04 100644 --- a/data/plugins/contextmenu.lua +++ b/data/plugins/contextmenu.lua @@ -122,6 +122,7 @@ function ContextMenu:on_mouse_moved(px, py) if self.selected >= 0 then core.request_cursor("arrow") end + return true end function ContextMenu:on_selected(item) @@ -219,8 +220,8 @@ local root_view_update = RootView.update local root_view_draw = RootView.draw function RootView:on_mouse_moved(...) + if menu:on_mouse_moved(...) then return end root_view_on_mouse_moved(self, ...) - menu:on_mouse_moved(...) end -- this function is mostly copied from lite-xl's source