From 5d42a78c4780613b7a2770309b7c4901be7bcc10 Mon Sep 17 00:00:00 2001 From: Kamil Jarosz Date: Sat, 13 Jul 2024 16:39:02 +0200 Subject: [PATCH] desktop: Ignore input when the context menu is open This matches FP's behavior: both keyboard and mouse input should be ignored. --- desktop/src/app.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/desktop/src/app.rs b/desktop/src/app.rs index a369841a5..4c1d4cf73 100644 --- a/desktop/src/app.rs +++ b/desktop/src/app.rs @@ -291,6 +291,10 @@ impl App { check_redraw = true; } WindowEvent::MouseWheel { delta, .. } => { + if self.gui.borrow_mut().is_context_menu_visible() { + return; + } + use ruffle_core::events::MouseWheelDelta; use winit::event::MouseScrollDelta; let delta = match delta { @@ -322,6 +326,10 @@ impl App { modifiers = new_modifiers; } WindowEvent::KeyboardInput { event, .. } => { + if self.gui.borrow_mut().is_context_menu_visible() { + return; + } + // Handle fullscreen keyboard shortcuts: Alt+Return, Escape. match event { KeyEvent {