Commit c801d6d3 authored by Stephen A Pohl's avatar Stephen A Pohl
Browse files

Bug 1684739: Only check if swipe tracking is enabled on macOS if the event is...

Bug 1684739: Only check if swipe tracking is enabled on macOS if the event is a scrollwheel event. r=mstange, a=RyanVM

Differential Revision: https://phabricator.services.mozilla.com/D144728
parent cbc78048
......@@ -2870,15 +2870,6 @@ NSEvent* gLastDragMouseDownEvent = nil; // [strong]
}
- (bool)shouldConsiderStartingSwipeFromEvent:(NSEvent*)anEvent {
// This method checks whether the AppleEnableSwipeNavigateWithScrolls global
// preference is set. If it isn't, fluid swipe tracking is disabled, and a
// horizontal two-finger gesture is always a scroll (even in Safari). This
// preference can't (currently) be set from the Preferences UI -- only using
// 'defaults write'.
if (![NSEvent isSwipeTrackingFromScrollEventsEnabled]) {
return false;
}
// Only initiate horizontal tracking for gestures that have just begun --
// otherwise a scroll to one side of the page can have a swipe tacked on
// to it.
......@@ -2888,6 +2879,15 @@ NSEvent* gLastDragMouseDownEvent = nil; // [strong]
return false;
}
// This method checks whether the AppleEnableSwipeNavigateWithScrolls global
// preference is set. If it isn't, fluid swipe tracking is disabled, and a
// horizontal two-finger gesture is always a scroll (even in Safari). This
// preference can't (currently) be set from the Preferences UI -- only using
// 'defaults write'.
if (![NSEvent isSwipeTrackingFromScrollEventsEnabled]) {
return false;
}
// Only initiate horizontal tracking for events whose horizontal element is
// at least eight times larger than its vertical element. This minimizes
// performance problems with vertical scrolls (by minimizing the possibility
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment