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

Incorrect state of mouse cursor

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: P4 P4
    • tbd
    • 8u192
    • javafx
    • x86_64
    • linux_redhat_6.0

      ADDITIONAL SYSTEM INFORMATION :
      Redhat Enterprise Linux 6.8 x64

      A DESCRIPTION OF THE PROBLEM :
      Cursor set via Node.setCursor() is not correctly shown.
      This appears to only effect Redhat Enterprise Linux 6.8. Same code running on Windows 7 works as expected.
      Interestingly if you set a conditional breakpoint in eclipse javafx.scene.Scene.MouseHandler.updateCursorFrame() with "System.out.println(this.currCursorFrame); return false;" then the cursor displays correctly. This could likely indicate some threading/timing issue?

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      Run the example
      Move the mouse in and out of the red box

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      Hand cursor only shown when mouse moved over the red box
      ACTUAL -
      Hand cursor shown when mouse moved outside in the red box, however normal cursor seen when inside.. i.e. the complete opposite

      ---------- BEGIN SOURCE ----------
      import javafx.application.Application;
      import javafx.geometry.Insets;
      import javafx.scene.Cursor;
      import javafx.scene.Scene;
      import javafx.scene.layout.HBox;
      import javafx.scene.layout.VBox;
      import javafx.stage.Stage;

      public class MouseCursorIssue extends Application {

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

          @Override
          public void start(Stage primaryStage) throws Exception {
              VBox inner = new VBox();
              inner.setStyle("-fx-background-color: red");
              inner.setPrefSize(30, 30);
              inner.setCursor(Cursor.OPEN_HAND);

              HBox outer = new HBox(inner);
              outer.setPadding(new Insets(40));
              Scene scene = new Scene(outer);
              primaryStage.setScene(scene);
              primaryStage.show();
          }

      }
      ---------- END SOURCE ----------

      CUSTOMER SUBMITTED WORKAROUND :
      None known

      FREQUENCY : always


            Unassigned Unassigned
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: