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

Robot.mouseMove changes displays ONLY to point in their shared X or Y coordinate.

XMLWordPrintable

    • x86
    • other

      FULL PRODUCT VERSION :
      java version "1.8.0_144"
      Java(TM) SE Runtime Environment (build 1.8.0_144-b01)
      Java HotSpot(TM) Client VM (build 25.144-b01, mixed mode)


      ADDITIONAL OS VERSION INFORMATION :
      Microsoft Windows [Version 10.0.15063]

      EXTRA RELEVANT SYSTEM CONFIGURATION :
      I have two displays. The laptop display is 3840x2160 pixels scaled at 175%. The additional monitor is 1920x1080 pixels scaled at 100%.

      A DESCRIPTION OF THE PROBLEM :
      With two displays, they will typically share some value range of Y, if they are logically side by side, or of X, if they are logically one above the other. Using Robot.mouseMove I find that I can only move from one screen to the other if the destination has the shared coordinate value in the shared range.

      Note that when I say Java 1.7.0_80 worked, it did not take scaling into account but it did move the mouse between displays without regard to the shared range of X or Y.

      I have also tried this in Java 9 and the same problem exists there. That has different problems with scaling in that it applies scaling of the main display to both that and the unscaled second display. But it has this same problem.

      REGRESSION. Last worked in version 7u80

      ADDITIONAL REGRESSION INFORMATION:
      java version "1.8.0_144"
      Java(TM) SE Runtime Environment (build 1.8.0_144-b01)
      Java HotSpot(TM) Client VM (build 25.144-b01, mixed mode)

      If you need to contact me regarding any bug report I've submitter please use my personal email glystad@centurytel.net since my work email, glystad@worksoft.com will become invalid sometime next week.

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      Compile and Java application of your choice in Java 1.8.
      Run it in a debugger or run it and attach with a debugger.
      Stop at a breakpoint.
      Use the debugger's expression evaluator to evaluate an expression of the form
      (new Robot()).mouseMove(<X>, <Y>) for appropriate value of X and Y. There must be valid values of the (X, Y) in the destination display that are not in the shared range. If not, reposition the displays in the Display control panel.
      If the displays are side by side their coordinate ranges should be made to overlap for some Y values but not all. Moving the mouse to the other display from were it starts will not work if the Y value is not shared by the displays.

      I have not tried this with 3 dispays, say in a row horizontally. It would be interesting to try to move from the far left to the far right and see if the display in the middle has to include the destination Y value. I don't have 3 displays to try that.

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      The mouse should move to the given coordinates provided that they are valid on the destination display. The current position of the mouse should have nothing to do with the success of the move.
      ACTUAL -
      The mouse will not move to coordinates on another display that do not have the X or Y range of values that the two displays share.

      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
      Any Java application will do.
      ---------- END SOURCE ----------

      CUSTOMER SUBMITTED WORKAROUND :
      Make 2 moves. You can move to the other display in the region of shared X or Y. Then move to the desired location in the second display.

        1. Main.java
          1 kB
          Pardeep Sharma

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

              Created:
              Updated: