Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3)

Issue 2461323002: Mac: Support Sierra's broken MouseWheel events. (Closed)

Created:
4 years, 1 month ago by tapted
Modified:
4 years, 1 month ago
Reviewers:
Avi (use Gerrit)
CC:
chromium-reviews, chrome-apps-syd-reviews_chromium.org
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Mac: Support Sierra's broken MouseWheel events. Since 10.12.1, Sierra has started sending MouseWheel events (from physical, clicky mouse wheels) with a single "tick" (or repeated slow ticks) all with -[NSEvent deltaY] equal to zero ([NSEveevent scrollingDeltaY] is also zero. This affects all applications on macOS including Safari, Console, and any NSScrollView. After poking around the events generated by my "Logitech B100 model M-U0026" optical mouse, I discovered we can use kCGScrollWheelEventPointDeltaAxis1 to get an appropriate value to use for these events. A single, "slow" tick has kCGScrollWheelEventPointDeltaAxis1 equal to +/- 1, and they go up by whole integers (e.g. when using CGEventGetDoubleValueField rather than CGEventGetIntegerValueField). When scrolling "fast' the value "is about a tenth" of what starts to appear in -[NSEvent deltaY]. There doesn't really appear to be a linear relationship between these (there's probably some internal state applying momentum in a different way), but 10 happens to be what CGEventSourceGetPixelsPerLine() reports. So to fix, detect an event that would have zero scroll deltas when it shouldn't, and replace the zero delta with the value from kCGScrollWheelEventPointDeltaAxis1 multiplied by some constant instead. BUG=660773 TEST=On macOS Sierra 10.12.1, scroll a web page with a physical "clicky" wheel mouse very slowly, by single ticks. The page should always scroll a little bit for each click.

Patch Set 1 #

Patch Set 2 : events_mac fix #

Total comments: 2

Patch Set 3 : Clearer comment #

Patch Set 4 : Horizontal is a trap - stay clear #

Unified diffs Side-by-side diffs Delta from patch set Stats (+43 lines, -7 lines) Patch
M content/browser/renderer_host/input/web_input_event_builders_mac.mm View 1 2 3 1 chunk +23 lines, -5 lines 0 comments Download
M ui/events/cocoa/events_mac.mm View 1 2 3 1 chunk +20 lines, -2 lines 0 comments Download

Messages

Total messages: 21 (16 generated)
tapted
Hi Avi.... WDYT? Obviously Apple need to fix this, but this is driving me insane. ...
4 years, 1 month ago (2016-10-31 06:32:16 UTC) #11
Avi (use Gerrit)
Massive :/ I know what you mean with "There doesn't really appear to be a ...
4 years, 1 month ago (2016-10-31 13:32:59 UTC) #12
tapted
On 2016/10/31 13:32:59, Avi wrote: > Massive :/ > > I know what you mean ...
4 years, 1 month ago (2016-11-01 02:29:46 UTC) #17
Avi (use Gerrit)
On 2016/11/01 02:29:46, tapted wrote: > On 2016/10/31 13:32:59, Avi wrote: > > Massive :/ ...
4 years, 1 month ago (2016-11-01 04:49:55 UTC) #20
tapted
4 years, 1 month ago (2016-11-01 06:45:46 UTC) #21
ooh - I just got my hands on the 10.12.2 Developer Seed and it looks like this
is fixed. (at least with the hardware I tried). So, I guess now we just hold our
breath.

Powered by Google App Engine
This is Rietveld 408576698