< prev index next >

src/java.desktop/windows/classes/sun/awt/windows/WRobotPeer.java

Print this page
rev 60071 : 8211999: Window positioning bugs due to overlapping GraphicsDevice bounds (Windows/HiDPI)
Reviewed-by: XXX

@@ -27,18 +27,18 @@
 
 import java.awt.Point;
 import java.awt.Rectangle;
 import java.awt.peer.RobotPeer;
 
-import sun.java2d.SunGraphicsEnvironment;
+import static sun.java2d.SunGraphicsEnvironment.toDeviceSpaceAbs;
 
 final class WRobotPeer implements RobotPeer {
 
     public native void mouseMoveImpl(int x, int y);
     @Override
     public void mouseMove(int x, int y) {
-        Point point = SunGraphicsEnvironment.convertToDeviceSpace(x, y);
+        Point point = toDeviceSpaceAbs(x, y);
         mouseMoveImpl(point.x, point.y);
     }
     @Override
     public native void mousePress(int buttons);
     @Override

@@ -62,7 +62,12 @@
         int[] pixelArray = new int[bounds.width*bounds.height];
         getRGBPixels(bounds.x, bounds.y, bounds.width, bounds.height, pixelArray);
         return pixelArray;
     }
 
+    @Override
+    public boolean useAbsoluteCoordinates() {
+        return true;
+    }
+
     private native void getRGBPixels(int x, int y, int width, int height, int[] pixelArray);
 }
< prev index next >