-
Bug
-
Resolution: Fixed
-
P3
-
jfx14
-
MacBook Pro Retina
java.runtime.version: 14-ea+30-1385
javafx.runtime.version: 14-ea+7
-
x86_64
-
os_x
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8242222 | 8u261 | Kevin Rushforth | P3 | Resolved | Fixed | b02 |
JDK-8244424 | 8u251 | Kevin Rushforth | P3 | Closed | Fixed | b34 |
JDK-8247265 | jfx11.0.8 | Kevin Rushforth | P3 | Resolved | Fixed |
On my MacBook Pro I can observe the following incorrect behavior for gestures. See attached demo program. (I can't say what the behavior
on other platforms is.)
When I move two fingers over the built-in track pad, I get the following kind of output:
setOnScroll: 0,000000 0,000000 1,000000 1,000000 0
setOnScroll: 0,000000 0,000000 2,000000 2,000000 0
setOnScroll: 0,000000 0,000000 1,000000 1,000000 0
setOnScroll: 0,000000 0,000000 1,000000 1,000000 0
setOnScroll: 1,000000 1,000000 1,000000 1,000000 0
setOnScroll: 1,000000 1,000000 2,000000 2,000000 0
setOnScroll: 1,000000 1,000000 1,000000 1,000000 0
setOnScroll: 1,000000 1,000000 1,000000 1,000000 0
The values are: e.getDeltaX(), e.getTotalDeltaX(), e.getDeltaY(), e.getTotalDeltaY(), e.getTouchCount()
This is wrong for several reasons according to the documentation for ScrollEvent:
1. The sequence of events for one gesture is never surrounded by SCROLL_STARTED and SCROLL_FINISHED.
2. The total-delta values are never accumulated. They seem to be the same as the delta values.
3. The touch-count is always 0. I'd expected 2 in this case.
This is also inconsistent with zoom events, where I get at least sometimes a zoom-started or zoom-finished notification. But this behavior is also not correct because it seems the zoom events are not surrounded correctly. Often I just get something like this:
setOnZoom: 0,998001
setOnZoom: 0,998001
setOnZoom: 0,994003
setOnZoomFinished
setOnZoomStarted
For rotation events the accumulation behavior actually works in contrast to the scroll events.
When I now attach an USB mouse to my Mac and create scroll events with the mouse wheel, the behavior is also wrong. The documentation says: "The totalDeltaX and totalDeltaY contain the cumulative values for the whole gesture, zeros for mouse wheel". As you can see here, the total-deltas for y are not zeros.
setOnScroll: 0,000000 0,000000 1,000061 1,000061 0
setOnScroll: 0,000000 0,000000 1,000061 1,000061 0
setOnScroll: 0,000000 0,000000 1,000061 1,000061 0
setOnScroll: 0,000000 0,000000 1,000061 1,000061 0
setOnScroll: 0,000000 0,000000 4,296417 4,296417 0
setOnScroll: 0,000000 0,000000 -1,000061 -1,000061 0
setOnScroll: 0,000000 0,000000 -11,195526 -11,195526 0
setOnScroll: 0,000000 0,000000 -38,627014 -38,627014 0
setOnScroll: 0,000000 0,000000 -50,805664 -50,805664 0
setOnScroll: 0,000000 0,000000 -52,142639 -52,142639 0
The current behavior is especially problematic for me because there does not seem to be any reliable way now to distinguish between mouse and track pad generated scrolling for which I have to take differnt actions.
on other platforms is.)
When I move two fingers over the built-in track pad, I get the following kind of output:
setOnScroll: 0,000000 0,000000 1,000000 1,000000 0
setOnScroll: 0,000000 0,000000 2,000000 2,000000 0
setOnScroll: 0,000000 0,000000 1,000000 1,000000 0
setOnScroll: 0,000000 0,000000 1,000000 1,000000 0
setOnScroll: 1,000000 1,000000 1,000000 1,000000 0
setOnScroll: 1,000000 1,000000 2,000000 2,000000 0
setOnScroll: 1,000000 1,000000 1,000000 1,000000 0
setOnScroll: 1,000000 1,000000 1,000000 1,000000 0
The values are: e.getDeltaX(), e.getTotalDeltaX(), e.getDeltaY(), e.getTotalDeltaY(), e.getTouchCount()
This is wrong for several reasons according to the documentation for ScrollEvent:
1. The sequence of events for one gesture is never surrounded by SCROLL_STARTED and SCROLL_FINISHED.
2. The total-delta values are never accumulated. They seem to be the same as the delta values.
3. The touch-count is always 0. I'd expected 2 in this case.
This is also inconsistent with zoom events, where I get at least sometimes a zoom-started or zoom-finished notification. But this behavior is also not correct because it seems the zoom events are not surrounded correctly. Often I just get something like this:
setOnZoom: 0,998001
setOnZoom: 0,998001
setOnZoom: 0,994003
setOnZoomFinished
setOnZoomStarted
For rotation events the accumulation behavior actually works in contrast to the scroll events.
When I now attach an USB mouse to my Mac and create scroll events with the mouse wheel, the behavior is also wrong. The documentation says: "The totalDeltaX and totalDeltaY contain the cumulative values for the whole gesture, zeros for mouse wheel". As you can see here, the total-deltas for y are not zeros.
setOnScroll: 0,000000 0,000000 1,000061 1,000061 0
setOnScroll: 0,000000 0,000000 1,000061 1,000061 0
setOnScroll: 0,000000 0,000000 1,000061 1,000061 0
setOnScroll: 0,000000 0,000000 1,000061 1,000061 0
setOnScroll: 0,000000 0,000000 4,296417 4,296417 0
setOnScroll: 0,000000 0,000000 -1,000061 -1,000061 0
setOnScroll: 0,000000 0,000000 -11,195526 -11,195526 0
setOnScroll: 0,000000 0,000000 -38,627014 -38,627014 0
setOnScroll: 0,000000 0,000000 -50,805664 -50,805664 0
setOnScroll: 0,000000 0,000000 -52,142639 -52,142639 0
The current behavior is especially problematic for me because there does not seem to be any reliable way now to distinguish between mouse and track pad generated scrolling for which I have to take differnt actions.
- backported by
-
JDK-8242222 [macos] Gestures handled incorrectly due to missing events
- Resolved
-
JDK-8247265 [macos] Gestures handled incorrectly due to missing events
- Resolved
-
JDK-8244424 [macos] Gestures handled incorrectly due to missing events
- Closed
- relates to
-
JDK-8242106 [macos] Remove obsolete GlassView2D.m class
- Resolved
-
JDK-8242122 Total deltas for scroll events from mouse wheel are wrong
- Open
(2 links to)