diff --git a/atom/browser/common_web_contents_delegate_mac.mm b/atom/browser/common_web_contents_delegate_mac.mm index 69117f190532..aa675408305a 100644 --- a/atom/browser/common_web_contents_delegate_mac.mm +++ b/atom/browser/common_web_contents_delegate_mac.mm @@ -6,9 +6,14 @@ #import +#include "brightray/browser/mac/event_dispatching_window.h" #include "content/public/browser/native_web_keyboard_event.h" #include "ui/events/keycodes/keyboard_codes.h" +@interface NSWindow (EventDispatchingWindow) +- (void)redispatchKeyEvent:(NSEvent*)event; +@end + namespace atom { void CommonWebContentsDelegate::HandleKeyboardEvent( @@ -22,18 +27,8 @@ void CommonWebContentsDelegate::HandleKeyboardEvent( if (event.windowsKeyCode == ui::VKEY_ESCAPE && is_html_fullscreen()) ExitFullscreenModeForTab(source); - BOOL handled = [[NSApp mainMenu] performKeyEquivalent:event.os_event]; - if (!handled && event.os_event.window) { - // Handle the cmd+~ shortcut. - if ((event.os_event.modifierFlags & NSCommandKeyMask) /* cmd */ && - (event.os_event.keyCode == 50 /* ~ */)) { - if (event.os_event.modifierFlags & NSShiftKeyMask) { - [NSApp sendAction:@selector(_cycleWindowsReversed:) to:nil from:nil]; - } else { - [NSApp sendAction:@selector(_cycleWindows:) to:nil from:nil]; - } - } - } + if (event.os_event.window) + [event.os_event.window redispatchKeyEvent:event.os_event]; } } // namespace atom diff --git a/atom/browser/native_window_mac.mm b/atom/browser/native_window_mac.mm index 679b1dc0ec1b..e15ff0c6cee6 100644 --- a/atom/browser/native_window_mac.mm +++ b/atom/browser/native_window_mac.mm @@ -15,6 +15,7 @@ #include "base/strings/sys_string_conversions.h" #include "brightray/browser/inspectable_web_contents.h" #include "brightray/browser/inspectable_web_contents_view.h" +#include "brightray/browser/mac/event_dispatching_window.h" #include "content/public/browser/browser_accessibility_state.h" #include "content/public/browser/web_contents.h" #include "content/public/browser/render_view_host.h" @@ -270,7 +271,7 @@ bool ScopedDisableResize::disable_resize_ = false; @end -@interface AtomNSWindow : NSWindow { +@interface AtomNSWindow : EventDispatchingWindow { @private atom::NativeWindowMac* shell_; bool enable_larger_than_screen_; diff --git a/vendor/brightray b/vendor/brightray index 717d92968d79..2f931b6a8947 160000 --- a/vendor/brightray +++ b/vendor/brightray @@ -1 +1 @@ -Subproject commit 717d92968d7959814060b9409c4720ab647bd90e +Subproject commit 2f931b6a8947fb9c336d880d9ddac8987527ac81