Bug 1549800 - Remove all code conditional on USE_CLICK_HOLD_CONTEXTMENU. r=mstange
authorChristina <ccheung@mozilla.com>
Mon, 13 May 2019 20:31:56 +0000
changeset 532476 5d66a70eebdbe0e8cbd592350741cfcab1420b0d
parent 532475 e3fc2a2d52de73e82fbf2fe0d4de1afed118d056
child 532477 d8a1c2fa4ea526b7185459ef414828efb8bf9841
push id11268
push usercsabou@mozilla.com
push dateTue, 14 May 2019 15:24:22 +0000
treeherdermozilla-beta@5fb7fcd568d6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmstange
bugs1549800
milestone68.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 1549800 - Remove all code conditional on USE_CLICK_HOLD_CONTEXTMENU. r=mstange Differential Revision: https://phabricator.services.mozilla.com/D30974
widget/cocoa/nsChildView.mm
--- a/widget/cocoa/nsChildView.mm
+++ b/widget/cocoa/nsChildView.mm
@@ -191,22 +191,16 @@ static NSMutableDictionary* sNativeKeyEv
 - (void)clearCorners;
 
 - (void)setGLOpaque:(BOOL)aOpaque;
 
 // Overlay drawing functions for traditional CGContext drawing
 - (void)drawTitleString;
 - (void)maskTopCornersInContext:(CGContextRef)aContext;
 
-#if USE_CLICK_HOLD_CONTEXTMENU
-// called on a timer two seconds after a mouse down to see if we should display
-// a context menu (click-hold)
-- (void)clickHoldCallback:(id)inEvent;
-#endif
-
 #ifdef ACCESSIBILITY
 - (id<mozAccessible>)accessible;
 #endif
 
 - (LayoutDeviceIntPoint)convertWindowCoordinates:(NSPoint)aPoint;
 - (LayoutDeviceIntPoint)convertWindowCoordinatesRoundDown:(NSPoint)aPoint;
 
 - (BOOL)inactiveWindowAcceptsMouseEvent:(NSEvent*)aEvent;
@@ -3424,52 +3418,16 @@ NSEvent* gLastDragMouseDownEvent = nil;
       }
     }
 
     mGeckoChild->WillPaintWindow();
   }
   [super viewWillDraw];
 }
 
-#if USE_CLICK_HOLD_CONTEXTMENU
-//
-// -clickHoldCallback:
-//
-// called from a timer two seconds after a mouse down to see if we should display
-// a context menu (click-hold). |anEvent| is the original mouseDown event. If we're
-// still in that mouseDown by this time, put up the context menu, otherwise just
-// fuhgeddaboutit. |anEvent| has been retained by the OS until after this callback
-// fires so we're ok there.
-//
-// This code currently messes in a bunch of edge cases (bugs 234751, 232964, 232314)
-// so removing it until we get it straightened out.
-//
-- (void)clickHoldCallback:(id)theEvent;
-{
-  NS_OBJC_BEGIN_TRY_ABORT_BLOCK;
-
-  if (theEvent == [NSApp currentEvent]) {
-    // we're still in the middle of the same mousedown event here, activate
-    // click-hold context menu by triggering the right mouseDown action.
-    NSEvent* clickHoldEvent = [NSEvent mouseEventWithType:NSRightMouseDown
-                                                 location:[theEvent locationInWindow]
-                                            modifierFlags:[theEvent modifierFlags]
-                                                timestamp:[theEvent timestamp]
-                                             windowNumber:[theEvent windowNumber]
-                                                  context:[theEvent context]
-                                              eventNumber:[theEvent eventNumber]
-                                               clickCount:[theEvent clickCount]
-                                                 pressure:[theEvent pressure]];
-    [self rightMouseDown:clickHoldEvent];
-  }
-
-  NS_OBJC_END_TRY_ABORT_BLOCK;
-}
-#endif
-
 // If we've just created a non-native context menu, we need to mark it as
 // such and let the OS (and other programs) know when it opens and closes
 // (this is how the OS knows to close other programs' context menus when
 // ours open).  We send the initial notification here, but others are sent
 // in nsCocoaWindow::Show().
 - (void)maybeInitContextMenuTracking {
   NS_OBJC_BEGIN_TRY_ABORT_BLOCK;
 
@@ -3957,21 +3915,16 @@ NSEvent* gLastDragMouseDownEvent = nil;
 
   if ([self maybeRollup:theEvent] ||
       !ChildViewMouseTracker::WindowAcceptsEvent([self window], theEvent, self, isClickThrough)) {
     // Remember blocking because that means we want to block mouseup as well.
     mBlockedLastMouseDown = YES;
     return;
   }
 
-#if USE_CLICK_HOLD_CONTEXTMENU
-  // fire off timer to check for click-hold after two seconds. retains |theEvent|
-  [self performSelector:@selector(clickHoldCallback:) withObject:theEvent afterDelay:2.0];
-#endif
-
   // in order to send gecko events we'll need a gecko widget
   if (!mGeckoChild) return;
   if (mTextInputHandler->OnHandleEvent(theEvent)) {
     return;
   }
 
   NSUInteger modifierFlags = [theEvent modifierFlags];