JDK-8183399 : [macOSX] Scroll events finish with invalid delta values
  • Type: Bug
  • Component: javafx
  • Sub-Component: other
  • Affected Version: 8,9
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • OS: os_x
  • CPU: x86
  • Submitted: 2017-06-30
  • Updated: 2018-11-20
  • Resolved: 2018-11-20
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.
Other
openjfx12 b03Fixed
Description
FULL PRODUCT VERSION :
java version "1.8.0_131"
Java(TM) SE Runtime Environment (build 1.8.0_131-b11)
Java HotSpot(TM) 64-Bit Server VM (build 25.131-b11, mixed mode)

ADDITIONAL OS VERSION INFORMATION :
MacOS X 10.12.5 Sierra

Darwin Kernel Version 16.6.0: Fri Apr 14 16:21:16 PDT 2017; root:xnu-3789.60.24~6/RELEASE_X86_64 x86_64

EXTRA RELEVANT SYSTEM CONFIGURATION :
Apple Magic Mouse or Magic Touchpad.

A DESCRIPTION OF THE PROBLEM :
At the end of a sequence of scroll events the absolute value of the delta values are incorrect. Normally the values slowly increase, hit a maximum, then slowly decrease. But when printing out the value one can see that at the end the absolute value of the delta values becomes big again.

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
This can be reproduced by running the provided sample code and performing a scroll event via the touch pad or the magic mouse on the label in the center of the window. 

But basically this bug is visible in any JavaFX application that has a ListView in it. When performing quick scrolling via the touch pad one can see that at the end of the scroll operation the list view items "jump". 

EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Smooth ending of any scrolling operation.
ACTUAL -
"Stuttering" at the end when scrolling a ListView.

REPRODUCIBILITY :
This bug can be reproduced always.

---------- BEGIN SOURCE ----------
import javafx.application.Application;
import javafx.geometry.Pos;
import javafx.scene.Scene;
import javafx.scene.control.Label;
import javafx.stage.Stage;

public class ScrollBugApp extends Application {

    @Override
    public void start(Stage primaryStage) throws Exception {
        Label label = new Label("Scroll On Me!");
        label.setAlignment(Pos.CENTER);
        label.setOnScrollStarted(evt ->  System.out.println("--- Scroll started ----"));
        label.setOnScroll(evt -> System.out.println(evt.getDeltaY()));
        Scene scene = new Scene(label);
        primaryStage.setScene(scene);
        primaryStage.setWidth(200);
        primaryStage.setHeight(200);
        primaryStage.centerOnScreen();
        primaryStage.show();
    }

    public static void main(String[] args) {
        launch(args);
    }
}
---------- END SOURCE ----------


Comments
Changeset: 6859462e6792 Author: jvos Date: 2018-11-20 15:29 +0100 URL: http://hg.openjdk.java.net/openjfx/jfx-dev/rt/rev/6859462e6792 8183399: long scroll events on mac delta Reviewed-by: kcr
20-11-2018

Changeset: 6859462e6792 Author: jvos Date: 2018-11-20 15:29 +0100 URL: http://hg.openjdk.java.net/openjfx/jfx-dev/rt/rev/6859462e6792 8183399: long scroll events on mac delta Reviewed-by: kcr
20-11-2018

webrev at http://cr.openjdk.java.net/~jvos/8183399/webrev.00/ fix in github at https://github.com/javafxports/openjdk-jfx/pull/274
20-11-2018

I found the root cause for this, and a potential solution, documented at https://github.com/javafxports/openjdk-jfx/issues/38
24-03-2018

Issue reproducible in JDK 8 and 9. Verified in macOS Sierra 10.12.5 8u05 : Fail 8u131 : Fail 9-ea+170 : Fail A typical output looks like this: ========================== --- Scroll started ---- 7.0001220703125 <-- first the values start to get bigger 10.0 13.000030517578125 12.0001220703125 12.0001220703125 13.000030517578125 12.0001220703125 13.000030517578125 12.0001220703125 11.00006103515625 10.0 9.000091552734375 <-- then the values are going down 9.000091552734375 8.000030517578125 8.000030517578125 7.0001220703125 7.0001220703125 6.00006103515625 6.00006103515625 6.00006103515625 <-- getting closer to zero 14.000091552734375 <-- but now all of a sudden bigger values again 14.000091552734375 <-- 13.000030517578125 <-- 11.00006103515625 <-- ==========================
03-07-2017