United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
JDK-8183399 : [macOSX] Scroll events finish with invalid delta values

Details
Type:
Bug
Submit Date:
2017-06-30
Status:
Open
Updated Date:
2017-08-25
Project Name:
JDK
Resolved Date:
Component:
javafx
OS:
os_x
Sub-Component:
other
CPU:
x86
Priority:
P4
Resolution:
Unresolved
Affected Versions:
8,9
Targeted Versions:
tbd_major

Related Reports

Sub Tasks

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
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 <--
==========================
                                     
2017-07-03



Hardware and Software, Engineered to Work Together