changeset 13630:e6eaa6f68ac4

8145784: [PIT] closed/java/awt/Robot/SpuriousMouseEvents/SpuriousMouseEvents.java fails Reviewed-by: alexsch, serb
author ssadetsky
date Tue, 12 Jan 2016 18:02:07 +0300
parents 5bb70b2df494
children dfb7f209f1a2
files src/java.desktop/unix/classes/sun/awt/X11/XRobotPeer.java
diffstat 1 files changed, 9 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/java.desktop/unix/classes/sun/awt/X11/XRobotPeer.java	Mon Jan 11 17:51:54 2016 +0300
+++ b/src/java.desktop/unix/classes/sun/awt/X11/XRobotPeer.java	Tue Jan 12 18:02:07 2016 +0300
@@ -31,6 +31,7 @@
 import sun.awt.SunToolkit;
 import sun.awt.UNIXToolkit;
 import sun.awt.X11GraphicsConfig;
+import sun.awt.X11GraphicsEnvironment;
 
 class XRobotPeer implements RobotPeer {
 
@@ -64,7 +65,14 @@
 
     @Override
     public void mouseMove(int x, int y) {
-        mouseMoveImpl(xgc, xgc.scaleUp(x), xgc.scaleUp(y));
+        X11GraphicsEnvironment x11ge = (X11GraphicsEnvironment)
+                GraphicsEnvironment.getLocalGraphicsEnvironment();
+        if(x11ge.runningXinerama()) {
+            Rectangle sb = xgc.getBounds();
+            mouseMoveImpl(xgc, xgc.scaleUp(x + sb.x), xgc.scaleUp(y + sb.y));
+        } else {
+            mouseMoveImpl(xgc, xgc.scaleUp(x), xgc.scaleUp(y));
+        }
     }
 
     @Override