Don't use the gesture detector for scrolls and flings on macOS
When a touchpad is used on macOS, Qt receives both scroll wheel
events and touch events, which it forwards to Chromium.
The gesture detector in Chromium transforms the touch events into
scroll / fling gestures, and these interfere with the original scroll
wheel events from Qt, leading to broken scrolling.
This used to work in Qt 5.7 and lower because the scroll wheel events
had a higher precedence than gestures, but this is not the case
with newer versions of Chromium.
Furthermore the gesture detector in Chromium has the assumption that
it receives touch events from a touchscreen device, and not from a
touchpad, which implies different gesture behaviors (moving one finger
on a touchpad moves the mouse, whereas on a touchscreen it causes the
screen to move, aka scrolling). Thus it is not correct to use the
gesture detector for handling macOS touchpad events.
The fix is a temporary hack which discards scroll and fling gestures
on macOS, thus processing only wheel events received from Qt.
The proper fix will be to remove usage of the gesture detector on
macOS, and rather transform and forward QNativeGestures which
are received directly from the operating system, similarly to how
the Chrome browser handles it.
Task-number: QTBUG-58779
Change-Id: I1b1fc950d033c175aebd617d38591bf5d94b5adc
Reviewed-by:
Allan Sandfeld Jensen <allan.jensen@qt.io>
Showing
Please register or sign in to comment