On 30/09/16 19:48, Alexander Scherbatiy wrote:
On 30/09/16 19:33, Sergey Malenkov wrote:
I'm not sure. It can be a "false" scrolling when you accidentally
touched a Magic Mouse.
I think we should use threshold on the phase end, to ignore
accumulatedDelta less than 0.1
Could you review the updated fix:
http://cr.openjdk.java.net/~alexsch/8166591/webrev.07
The min threshold is added for the phase end.
Here is the updated version where the accumulated delta is not reset
at the phase end:
http://cr.openjdk.java.net/~alexsch/8166591/webrev.08
Thanks,
Alexandr.
Thanks,
Alexandr.
On Fri, Sep 30, 2016 at 6:18 PM, Sergey Bylokhov
<sergey.bylok...@oracle.com> wrote:
What will be the difference if we will scroll by one line at the "begin
phase"? probably it will be better if the the scroll will start
immediately
on first touch?
On 30.09.16 17:59, Alexander Scherbatiy wrote:
Hello,
Could you review the updated fix:
http://cr.openjdk.java.net/~alexsch/8166591/webrev.06
- The CPlatformResponder.handleScrollEvent(...) is updated to dispatch
a scroll event when delta or round delta is not equal to zero
- The native scrollStateWithPhase: method is updated to have
NSEvent as
an argument
Thanks,
Alexandr.
On 30/09/16 16:58, Sergey Malenkov wrote:
In the CPlatformResponder:
phase3 0 ~ 0.0 // mayBegan
phase2 0 ~ 0.0 // began
phase3 0 ~ 0.0222015380859375
phase3 0 ~ 0.0234222412109375
phase3 0 ~ 0.023956298828125
phase3 0 ~ 0.0242919921875
phase3 0 ~ 0.02447509765625
phase3 0 ~ 0.0246124267578125
phase3 0 ~ 0.024658203125
phase3 0 ~ 0.0222015380859375
phase3 0 ~ 0.0233306884765625
phase5 1 ~ 0.0 // end
In Java:
wheelRotation=0,preciseWheelRotation=-0.0222015380859375
wheelRotation=0,preciseWheelRotation=-0.0234222412109375
wheelRotation=0,preciseWheelRotation=-0.023956298828125
wheelRotation=0,preciseWheelRotation=-0.0242919921875
wheelRotation=0,preciseWheelRotation=-0.02447509765625
wheelRotation=0,preciseWheelRotation=-0.0246124267578125
wheelRotation=0,preciseWheelRotation=-0.024658203125
wheelRotation=0,preciseWheelRotation=-0.0222015380859375
wheelRotation=0,preciseWheelRotation=-0.0233306884765625
We ignored first two events, because of 0 & 0.0
We should not ignore last event, where 1 & 0.0
Seems we need to fix DeltaAccumulator.
On Fri, Sep 30, 2016 at 2:25 PM, Alexander Scherbatiy
<alexandr.scherba...@oracle.com> wrote:
Hello,
Could you review the updated fix:
http://cr.openjdk.java.net/~alexsch/8166591/webrev.05
The momentumPhase is used to detect the trackpad events.
Thanks,
Alexandr.
On 30/09/16 14:58, Sergey Malenkov wrote:
# 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.