Bug 673875 - Reenable guard for bug 770626 when swipe animations are disabled. r=smichaud

This commit is contained in:
Stephen Pohl 2013-04-12 23:04:52 -04:00
parent 6d01aff5b2
commit 9c2342a0b8

View File

@ -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