From 9c2342a0b8f86349bb3d491428a518f4ccba5cd0 Mon Sep 17 00:00:00 2001 From: Stephen Pohl Date: Fri, 12 Apr 2013 23:04:52 -0400 Subject: [PATCH] Bug 673875 - Reenable guard for bug 770626 when swipe animations are disabled. r=smichaud --- widget/cocoa/nsChildView.mm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/widget/cocoa/nsChildView.mm b/widget/cocoa/nsChildView.mm index 533857297573..4cc26dcf5895 100644 --- a/widget/cocoa/nsChildView.mm +++ b/widget/cocoa/nsChildView.mm @@ -3227,8 +3227,6 @@ NSEvent* gLastDragMouseDownEvent = nil; - (void)beginGestureWithEvent:(NSEvent *)anEvent { - NS_ASSERTION(mGestureState == eGestureState_None, "mGestureState should be eGestureState_None"); - if (!anEvent) return; @@ -3547,6 +3545,7 @@ NSEvent* gLastDragMouseDownEvent = nil; } __block BOOL animationCanceled = NO; + __block BOOL geckoSwipeEventSent = NO; // At this point, anEvent is the first scroll wheel event in a two-finger // horizontal gesture that we've decided to treat as a swipe. When we call // [NSEvent trackSwipeEventWithOptions:...], the OS interprets all @@ -3600,7 +3599,7 @@ NSEvent* gLastDragMouseDownEvent = nil; direction:0.0 delta:gestureAmount]; - if (phase == NSEventPhaseEnded) { + if (phase == NSEventPhaseEnded && !geckoSwipeEventSent) { // The result of the swipe is now known, so the main event can be sent. // The animation might continue even after this event was sent, so // don't tear down the animation overlay yet. @@ -3613,6 +3612,7 @@ NSEvent* gLastDragMouseDownEvent = nil; // gestureAmount is negative when it will be '-1' at isComplete, and // positive when it will be '1'. And phase is never equal to // NSEventPhaseEnded when gestureAmount will be '0' at isComplete. + geckoSwipeEventSent = YES; [self sendSwipeEvent:anEvent withKind:NS_SIMPLE_GESTURE_SWIPE allowedDirections:&allowedDirectionsCopy