Bug 435164 - Stop mapping Ctrl+Space to context menu on Cocoa. r=smichaud
authorJ. Ryan Stinnett <jryans@gmail.com>
Fri, 07 Mar 2014 20:17:48 -0600
changeset 191164 eb99c9d72f306ff451e1f3b7b0760f8970c8440e
parent 191163 ec6116366680a6b5eb0ee95e1ab55352a84c079d
child 191165 95a025765775fbfb695abe61701a663670acbfc0
push id474
push userasasaki@mozilla.com
push dateMon, 02 Jun 2014 21:01:02 +0000
treeherdermozilla-release@967f4cf1b31c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssmichaud
bugs435164
milestone30.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 435164 - Stop mapping Ctrl+Space to context menu on Cocoa. r=smichaud
widget/cocoa/TextInputHandler.mm
--- a/widget/cocoa/TextInputHandler.mm
+++ b/widget/cocoa/TextInputHandler.mm
@@ -1534,38 +1534,16 @@ TextInputHandler::HandleKeyDownEvent(NSE
     // XXX This is a special code only on Cocoa widget, why is this needed?
     if (firstResponder != [[mView window] firstResponder]) {
       PR_LOG(gLog, PR_LOG_ALWAYS,
         ("%p TextInputHandler::HandleKeyDownEvent, "
          "view lost focus by keydown event", this));
       return currentKeyEvent->IsDefaultPrevented();
     }
 
-    // If this is the context menu key command, send a context menu key event.
-    // XXX Should we dispatch context menu event at pressing kVK_PC_ContextMenu?
-    NSUInteger modifierFlags =
-      [aNativeEvent modifierFlags] & NSDeviceIndependentModifierFlagsMask;
-    if (modifierFlags == NSControlKeyMask &&
-        [[aNativeEvent charactersIgnoringModifiers] isEqualToString:@" "]) {
-      WidgetMouseEvent contextMenuEvent(true, NS_CONTEXTMENU, [mView widget],
-                                        WidgetMouseEvent::eReal,
-                                        WidgetMouseEvent::eContextMenuKey);
-      contextMenuEvent.modifiers = 0;
-
-      bool cmEventHandled = DispatchEvent(contextMenuEvent);
-      PR_LOG(gLog, PR_LOG_ALWAYS,
-        ("%p TextInputHandler::HandleKeyDownEvent, "
-         "context menu event dispatched, handled=%s%s",
-         this, TrueOrFalse(cmEventHandled),
-         Destroyed() ? " and widget was destroyed" : ""));
-      [mView maybeInitContextMenuTracking];
-      // Bail, there is nothing else to do here.
-      return (cmEventHandled || currentKeyEvent->IsDefaultPrevented());
-    }
-
     if (currentKeyEvent->IsDefaultPrevented()) {
       PR_LOG(gLog, PR_LOG_ALWAYS,
         ("%p TextInputHandler::HandleKeyDownEvent, "
          "keydown event's default is prevented", this));
       return true;
     }
   }