> # 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

Reply via email to