desktop: Ignore input when the context menu is open

This matches FP's behavior: both keyboard and mouse input should be ignored.
This commit is contained in:
Kamil Jarosz 2024-07-13 16:39:02 +02:00 committed by TÖRÖK Attila
parent 10c52ce706
commit 5d42a78c47
1 changed files with 8 additions and 0 deletions

View File

@ -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 {