From ab0cb10a227ea551b317c2e86b88312ff24ae4cf Mon Sep 17 00:00:00 2001 From: Micah Johnston Date: Mon, 7 Dec 2020 00:09:18 -0600 Subject: [PATCH] call DefWindowProc in the case of WM_SYSKEYDOWN. makes alt-f4 work. if we call DefWindowProc for non-system events, pressing alt or f10 puts focus on the (nonexistent) dropdown menu until the next click or keystroke, so we only call it in the case of WM_SYSKEYDOWN. --- src/win/window.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/win/window.rs b/src/win/window.rs index 06ff2a2..dcd356b 100644 --- a/src/win/window.rs +++ b/src/win/window.rs @@ -151,8 +151,6 @@ unsafe extern "system" fn wnd_proc( }, WM_CHAR | WM_SYSCHAR | WM_KEYDOWN | WM_SYSKEYDOWN | WM_KEYUP | WM_SYSKEYUP | WM_INPUTLANGCHANGE => { - // Will swallow menu key events. See druid code for how to - // solve that let opt_event = window_state.borrow_mut() .keyboard_state .process_message(hwnd, msg, wparam, lparam); @@ -163,7 +161,9 @@ unsafe extern "system" fn wnd_proc( .on_event(&mut window, Event::Keyboard(event)); } - return 0; + if msg != WM_SYSKEYDOWN { + return 0; + } } _ => {} }