<AWT Dev> [9] Review request for 8166591 [macos 10.12] Trackpad scrolling of text on OS X 10.12 Sierra is very fast (Trackpad, Retina only)

Sergey Malenkov malenkov at gmail.com
Fri Sep 30 10:58:04 UTC 2016


> # C  [AppKit+0x3a528e]  -[NSApplication _crashOnException:]+0x6d
>
> The app is crashed as soon as I start scrolling. Investigating...
> May be it is my fault during backporting.

Sorry, It was may fault.


> LWCToolkit.m:
> +// SCROLL EVENT MASK
> +#define SCROLL_PHASE_UNSUPPORTED 1
> ...
>
> replace the comment with the following one:
>
> +// TRACKPAD SCROLL EVENT PHASE

I discovered how we should detect mouse event properly: use both
properties phase and momentumPhase.
https://developer.apple.com/library/prerelease/content/documentation/Cocoa/Conceptual/EventOverview/HandlingTouchEvents/HandlingTouchEvents.html
"The momentumPhase property helps you detect momentum scrolling, in
which the hardware continues to issue scroll wheel events even though
the user is no longer physically scrolling."

if (phase==NULL) && (momentumPhase==NULL) -> this is a mouse event.

scrolling by trackpad generates the following events:

phase=mayBegan momentumPhase=null
phase=began momentumPhase=null
phase=continued momentumPhase=null
...
phase=continued momentumPhase=null
phase=ended momentumPhase=null
phase=null momentumPhase=began
phase=null momentumPhase=continued
...
phase=null momentumPhase=continued
phase=null momentumPhase=ended

So, we should generate PHASE_UNSUPPORTED only
if ((phase == NULL) && (momentumPhase == NULL))












-- 
Best regards,
Sergey A. Malenkov


More information about the awt-dev mailing list