diff --git a/atom/browser/native_window_mac.h b/atom/browser/native_window_mac.h index bf8125f119ac..f666aefbe565 100644 --- a/atom/browser/native_window_mac.h +++ b/atom/browser/native_window_mac.h @@ -165,7 +165,7 @@ class NativeWindowMac : public NativeWindow { - (void)setShell:(atom::NativeWindowMac*)shell; - (void)setEnableLargerThanScreen:(bool)enable; -- (BOOL)redispatchKeyEvent:(NSEvent*)event; +- (void)redispatchKeyEvent:(NSEvent*)event; - (BOOL)performKeyEquivalent:(NSEvent*)theEvent; @end diff --git a/atom/browser/native_window_mac.mm b/atom/browser/native_window_mac.mm index fe4cba4d16c8..a0b58d020908 100644 --- a/atom/browser/native_window_mac.mm +++ b/atom/browser/native_window_mac.mm @@ -337,34 +337,26 @@ bool ScopedDisableResize::disable_resize_ = false; - (void)sendEvent:(NSEvent*)event { if (!redispatchingEvent_) [super sendEvent:event]; - else - eventHandled_ = NO; } - (BOOL)performKeyEquivalent:(NSEvent*)event { if (redispatchingEvent_) return NO; - - if ([super performKeyEquivalent:event]) - return YES; - - return NO; + else + return [super performKeyEquivalent:event]; } -- (BOOL)redispatchKeyEvent:(NSEvent*)event { +- (void)redispatchKeyEvent:(NSEvent*)event { NSEventType eventType = [event type]; if (eventType != NSKeyDown && eventType != NSKeyUp && eventType != NSFlagsChanged) { - return YES; + return; } // Redispatch the event. - eventHandled_ = YES; redispatchingEvent_ = YES; [NSApp sendEvent:event]; redispatchingEvent_ = NO; - - return eventHandled_; } @end