8145784: [PIT] closed/java/awt/Robot/SpuriousMouseEvents/SpuriousMouseEvents.java fails
Reviewed-by: alexsch, serb
--- a/jdk/src/java.desktop/unix/classes/sun/awt/X11/XRobotPeer.java Mon Jan 11 17:51:54 2016 +0300
+++ b/jdk/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