1
0
Fork 0

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.
This commit is contained in:
Micah Johnston 2020-12-07 00:09:18 -06:00 committed by glowcoil
parent 08e56bd5ae
commit ab0cb10a22

View file

@ -151,8 +151,6 @@ unsafe extern "system" fn wnd_proc<H: WindowHandler>(
},
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,8 +161,10 @@ unsafe extern "system" fn wnd_proc<H: WindowHandler>(
.on_event(&mut window, Event::Keyboard(event));
}
if msg != WM_SYSKEYDOWN {
return 0;
}
}
_ => {}
}
}