Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8183399

[macOSX] Scroll events finish with invalid delta values

    XMLWordPrintable

Details

    • b03
    • x86
    • os_x

    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 ----------

      Attachments

        Activity

          People

            jvos Johan Vos
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: