Do not swap X & Y for for shift-scrolling on Mac
MacOSX scrollWheel event already provides the correct behavior. If the event (physical) source has precise deltas and comes from a trackpad or apple mouse then it has bidirectional deltas already and pressing shift key should not swap the axis. If the source of the event is an ordinary single-axis mouse, then the NSEvent already packs |delta_x| instead of |delta_y| (for shift-scroll). Also, it turns out that rails mode should only be used for trackpad. The logic in MosueWheelRailsFilter uses an auto-regressive filter to smooth out rails latching. This state is reset for a kPhaseScrollBegan. However, apple mice would always have a phase of kPhaseNone. Since it never resets it might lead to a large value in one axis (i.e., in y-axis after a vertical scroll phase) and when scrolling in the other direction occurs, the rails mode is set incorrectly. The side effects of this are zero scroll deltas which also fires a DCHECK in mouse_wheel_event_queue.cc: DCHECK(needs_update). To repro use an apple mouse and scroll vertically and then horizontally using the bidirectional wheel. Bug: 862661 Change-Id: I4e5210454fe7352ab0230b312f44e1a374f22f0c Reviewed-on: https://chromium-review.googlesource.com/1134434Reviewed-by:ccameron <ccameron@chromium.org> Reviewed-by:
Ken Buchanan <kenrb@chromium.org> Reviewed-by:
Ehsan Karamad <ekaramad@chromium.org> Commit-Queue: Ehsan Karamad <ekaramad@chromium.org> Cr-Commit-Position: refs/heads/master@{#577296}
Showing
Please register or sign in to comment