summaryrefslogtreecommitdiff
path: root/chromium/ui/events/gesture_detection/gesture_provider.cc
diff options
context:
space:
mode:
Diffstat (limited to 'chromium/ui/events/gesture_detection/gesture_provider.cc')
-rw-r--r--chromium/ui/events/gesture_detection/gesture_provider.cc16
1 files changed, 16 insertions, 0 deletions
diff --git a/chromium/ui/events/gesture_detection/gesture_provider.cc b/chromium/ui/events/gesture_detection/gesture_provider.cc
index 39b8a2d1504..6a37bed556f 100644
--- a/chromium/ui/events/gesture_detection/gesture_provider.cc
+++ b/chromium/ui/events/gesture_detection/gesture_provider.cc
@@ -297,6 +297,16 @@ class GestureProvider::GestureListenerImpl : public ScaleGestureListener,
const MotionEvent& secondary_pointer_down,
float raw_distance_x,
float raw_distance_y) override {
+ // Do not use gesture detection for scrolling on macOS, it is handled by real and synthesized
+ // wheel events received from Qt (the synthesized ones come from usage of a touchpad).
+ // The scroll gestures created by the gesture detector are incompatible with wheel events
+ // received by Qt, due to having an inverse Y coordinate and also because they overlap with
+ // each other, thus scrolling sometimes goes into one direction, and sometimes
+ // into the opposite direction.
+#if defined(TOOLKIT_QT) && defined(OS_MACOSX)
+ return true;
+#endif
+
float distance_x = raw_distance_x;
float distance_y = raw_distance_y;
if (!scroll_event_sent_ && e2.GetPointerCount() < 3) {
@@ -361,6 +371,12 @@ class GestureProvider::GestureListenerImpl : public ScaleGestureListener,
const MotionEvent& e2,
float velocity_x,
float velocity_y) override {
+ // Do not use gesture detection for flings on macOS. See explanation at the beginning
+ // of OnScroll.
+#if defined(TOOLKIT_QT) && defined(OS_MACOSX)
+ return true;
+#endif
+
if (snap_scroll_controller_.IsSnappingScrolls()) {
if (snap_scroll_controller_.IsSnapHorizontal()) {
velocity_y = 0;