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

java.awt.Robot.mouseMove fails in the lastest Windows 10 Build 1709 on high resolution

XMLWordPrintable

    • x86
    • windows_10

      FULL PRODUCT VERSION :
      java version "9.0.1"
      Java(TM) SE Runtime Environment (build 9.0.1+11)
      Java HotSpot(TM) 64-Bit Server VM (build 9.0.1+11, mixed mode)

      ADDITIONAL OS VERSION INFORMATION :
      Microsoft Windows [Version 10.0.16299.19]

      EXTRA RELEVANT SYSTEM CONFIGURATION :
      Used are two Dell P2415Q-0 at 3840x2160

      A DESCRIPTION OF THE PROBLEM :
      As soon as the robot class function mouseMove is used in the selected Windows 10 build the mouse will not be moved as expected.

      In the previous build this issue did not exist. It might be related to display scaling changes in the hew build.

      Test output, first number is requested, second received from MouseInfo class:
      X: 0|0.0 Y: 0.0
      X: 192|383.0 Y: 0.0
      X: 384|385.0 Y: 0.0
      X: 576|767.0 Y: 0.0
      X: 768|769.0 Y: 0.0
      X: 960|1151.0 Y: 0.0
      X: 1152|1153.0 Y: 0.0
      X: 1344|1535.0 Y: 0.0
      X: 1536|1537.0 Y: 0.0
      X: 1728|1919.0 Y: 0.0

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      Set the display to 3840x2160 and select a display scaling higher than 100%

      Set the cursor to arbitrary positions on the screen using the mouseMove function. Check if the cursor is placed correctly.

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      The cursor should be places exactly at the location which was requested.
      ACTUAL -
      The cursor does not move to the correct position. Moreover if the same coordinate is used again the cursor will jump back to the previous position.

      ERROR MESSAGES/STACK TRACES THAT OCCUR :
      No error messages.

      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
      public static void main(String[] args) {
      Robot worker;
      try {
      worker = new Robot();
      for(int i = 0; i < 1920; i+= 192)
      {
      worker.mouseMove(i, 0);
      worker.delay(200);
      System.out.println("X: " + i + "|" + MouseInfo.getPointerInfo().getLocation().getX() + " Y: " + MouseInfo.getPointerInfo().getLocation().getY());
      }
      } catch (AWTException e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
      }
      }
      ---------- END SOURCE ----------

      CUSTOMER SUBMITTED WORKAROUND :
      No workaround found so far.

            pardesha Pardeep Sharma
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: