JDK-8166591 : [macos 10.12] Trackpad scrolling of text on macOS 10.12 Sierra is very fast (Trackpad, Retina only)
  • Type: Bug
  • Component: client-libs
  • Sub-Component: javax.swing
  • Affected Version: 7u121,8u75,9
  • Priority: P2
  • Status: Resolved
  • Resolution: Fixed
  • OS: os_x
  • Submitted: 2016-09-23
  • Updated: 2017-11-29
  • Resolved: 2016-10-05
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 8 JDK 9 Other
8u112Fixed 9 b143Fixed openjdk7uFixed
Related Reports
Duplicate :  
Relates :  
Relates :  
Relates :  
Sub Tasks
JDK-8167492 :  
JDK-8169898 :  
Description
Regression: no.
Platform specific: Yes (OS X 10.12 with Retina display. Not reproducible on OS X 10.11 (with or without Retina), 10.12 without Retina display). 
It is reproducible only on trackpad. Mouse scrolling always works good. 
I tested  JTextArea inside JScrollPane with 8u112, 8u75, 9b137 on OS X 10.12 with retina display and trackpad scrolls very fast. 

Scrolling of JPanel with different Swing components  inside JScrollPane works good (by trackpad and mouse)
Scrolling of text inside JTextArea inside JScrollPane works very fast when I use trackpad and works good when I use mouse.
Comments
UR SQE OK to take the fix to CPU17_01 for better support Mac OS 10.12. Please, backport it to jdk8. Do we need to get it backported to jdk7?
06-10-2016

- webrev link: http://cr.openjdk.java.net/~alexsch/8166591/webrev-jdk8.00/ - review link: in progress http://mail.openjdk.java.net/pipermail/awt-dev/2016-October/012088.html - JPRT build link: http://scaaa637.us.oracle.com//archive/2016/09/2016-09-30-171436.Scherbatiy.jdk8u-dev - issue impact: Small trackpad scrolling leads that a text is scrolled too fast on Mac OS X Sierra 10.12. There is no a way to scroll a text slowly by using the trackpad. - fix rational: The delta values from the trackpad are summarized until the exceed a certain threshold. After that a scroll event is set to 1. -risks: The fix allows to fire a MouseWheelEvent with zero wheelRotation value. It could have some problems for applications which does not expect this. -suggested testing: run the manual test: test/javax/swing/plaf/basic/BasicScrollPaneUI/8166591/TooMuchWheelRotationEventsTest.java
05-10-2016

> There is manual regression test. Is there no automated test because neither robot, nor jemmy can not emulate sending a lot of small scroll values? Robot.mouseWheel(int wheelAmt) can generate only integer scroll values and there is no a method for trackpad emulation.
05-10-2016

The JDK 8u-dev backport request: http://mail.openjdk.java.net/pipermail/jdk8u-dev/2016-October/005985.html The JDK 8u-dev backport request: http://mail.openjdk.java.net/pipermail/awt-dev/2016-October/012087.html
05-10-2016

Reproducible with 7u121b08, same scenario.
05-10-2016

tested scrolling with fx standalone app (Ensemble.jar and DownloadTestingTool.jar) on OS X 10.12. Scrolling works smoothly. So, looks like FX is not affected.
03-10-2016

10/03/2016: Latest revision: http://cr.openjdk.java.net/~alexsch/8166591/webrev.09/
03-10-2016

9/30/2016: Latest revision: http://cr.openjdk.java.net/~alexsch/8166591/webrev.07/
30-09-2016

Review thread: http://mail.openjdk.java.net/pipermail/awt-dev/2016-September/012005.html
28-09-2016

The updated proposed fix: http://cr.openjdk.java.net/~alexsch/8166591/webrev.02 - Scroll mask is added which can have 3 values: mouse wheel, trackpad, and phase began - Values are accumulated for the trackpad only and wheelRotation value is only set then the accumulated value exceeds some threshold. Mouse wheel values are always rounded to 1 or -1 then its absolute value is smaller than 1. - Zero MouseWheelEvent.wheelRotation values are possible for the trackpad events.
28-09-2016

Please, provide Mac OS Version/Build of the system where the issue is reproduced.
27-09-2016

I will verify fix on this platform. Waiting for build...
26-09-2016

The proposed fix: http://cr.openjdk.java.net/~alexsch/8166591/webrev.00/ It should be verified on OS X 10.12 Sierra with Retina display.
26-09-2016

According to the Sergey's investigation: https://sites.google.com/site/malenkov/java/160926 ----- Sierra generates much more scroll events than El Capitan. So the native delta from the operating system became close to 0, but Swing still converts it to 1. This makes scrolling too harsh. -----
26-09-2016

Alexandr, please look at and evaluate this high priority issue
26-09-2016

[~idergali] Shouldn't it really be P2? See https://youtrack.jetbrains.com/issue/IDEA-158500
23-09-2016

[~ampopov] Is it reproducible on JDK 7?
23-09-2016

Downgrading to P3 as it is Mac OS 10.12, Trackpad and Retina specific.
23-09-2016