From a30905769239e0c81440c7121a458f34f7a39267 Mon Sep 17 00:00:00 2001 From: Stephen A Pohl Date: Thu, 26 Jan 2017 16:14:19 -0500 Subject: [PATCH] Backout 2823fca4f547 (bug 429824) for causing bug 1334140 in e10s. r=backout --- widget/cocoa/nsChildView.mm | 19 +++---------------- widget/cocoa/nsMenuBarX.h | 2 -- widget/cocoa/nsMenuBarX.mm | 10 ---------- 3 files changed, 3 insertions(+), 28 deletions(-) diff --git a/widget/cocoa/nsChildView.mm b/widget/cocoa/nsChildView.mm index 7ca30bbe459f..2ab284b9e150 100644 --- a/widget/cocoa/nsChildView.mm +++ b/widget/cocoa/nsChildView.mm @@ -5474,23 +5474,10 @@ GetIntegerDeltaForEvent(NSEvent* aEvent) handled = mTextInputHandler->HandleKeyDownEvent(theEvent); } - // We always allow keyboard events to propagate to keyDown: but if they are - // not handled we give menu items a chance to act. This allows for handling of - // custom shortcuts. Note that existing shortcuts cannot be reassigned yet and - // will have been handled by keyDown: before we get here. - if (!handled && mGeckoChild) { - nsCocoaWindow* widget = mGeckoChild->GetXULWindowWidget(); - if (widget) { - nsMenuBarX* mb = widget->GetMenuBar(); - if (mb) { - // Check if main menu wants to handle the event. - handled = mb->PerformKeyEquivalent(theEvent); - } - } - } + // We always allow keyboard events to propagate to keyDown: but if they are not + // handled we give special Application menu items a chance to act. if (!handled && sApplicationMenu) { - // Check if application menu wants to handle the event. - handled = [sApplicationMenu performKeyEquivalent:theEvent]; + [sApplicationMenu performKeyEquivalent:theEvent]; } NS_OBJC_END_TRY_ABORT_BLOCK; diff --git a/widget/cocoa/nsMenuBarX.h b/widget/cocoa/nsMenuBarX.h index ea20b1285709..f976ce4a665c 100644 --- a/widget/cocoa/nsMenuBarX.h +++ b/widget/cocoa/nsMenuBarX.h @@ -47,7 +47,6 @@ protected: @interface GeckoNSMenu : NSMenu { } -- (BOOL)performSuperKeyEquivalent:(NSEvent*)theEvent; @end // Objective-C class used as action target for menu items @@ -120,7 +119,6 @@ public: static void ResetNativeApplicationMenu(); void SetNeedsRebuild(); void ApplicationMenuOpened(); - bool PerformKeyEquivalent(NSEvent* theEvent); protected: void ConstructNativeMenus(); diff --git a/widget/cocoa/nsMenuBarX.mm b/widget/cocoa/nsMenuBarX.mm index 97fe4c1a7425..e4f8c748f2e5 100644 --- a/widget/cocoa/nsMenuBarX.mm +++ b/widget/cocoa/nsMenuBarX.mm @@ -527,11 +527,6 @@ void nsMenuBarX::ApplicationMenuOpened() } } -bool nsMenuBarX::PerformKeyEquivalent(NSEvent* theEvent) -{ - return [mNativeMenu performSuperKeyEquivalent:theEvent]; -} - // Hide the item in the menu by setting the 'hidden' attribute. Returns it in |outHiddenNode| so // the caller can hang onto it if they so choose. It is acceptable to pass nsull // for |outHiddenNode| if the caller doesn't care about the hidden node. @@ -881,11 +876,6 @@ static BOOL gMenuItemsExecuteCommands = YES; return NO; } -- (BOOL)performSuperKeyEquivalent:(NSEvent*)theEvent -{ - return [super performKeyEquivalent:theEvent]; -} - @end //