Give menu a chance to handle key event before window
This commit is contained in:
parent
d42d10a47c
commit
bd33961964
1 changed files with 5 additions and 0 deletions
|
@ -27,6 +27,11 @@ void CommonWebContentsDelegate::HandleKeyboardEvent(
|
|||
if (event.windowsKeyCode == ui::VKEY_ESCAPE && is_html_fullscreen())
|
||||
ExitFullscreenModeForTab(source);
|
||||
|
||||
// Send the event to the menu before sending it to the window
|
||||
if (event.os_event.type == NSKeyDown &&
|
||||
[[NSApp mainMenu] performKeyEquivalent:event.os_event])
|
||||
return;
|
||||
|
||||
if (event.os_event.window)
|
||||
[event.os_event.window redispatchKeyEvent:event.os_event];
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue