-
Bug
-
Resolution: Won't Fix
-
P3
-
1.3.1
-
sparc
-
solaris_9
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-2163874 | 1.3.1 | Unassigned | P5 | Closed | Won't Fix |
Under the right circumstances, the following test case can make a user's console session unusable. Clicking the "Robot.mouseMove" button moves the mouse to the upper-left of the Frame. There is a pause between pressing the button and the mouse cursor actually moving to the upper-left corner of the Frame. If, during this pause, you move the mouse, the cursor becomes "stuck" at the right-hand edge of the desktop. I've also reproduced the problem by clicking repeatedly on the button. The cursor moves to the upper left of the Frame and the double-click the Frame and maximized it.
At this point, you can move the mouse around and the cursor appears to move, but pressing the mouse button always acts like the mouse is at the right edge of the screen. This is especially frustrating when using point-to-focus, because I can't activate the terminal window in which I started the Java app to kill it. Sometimes, the only way to restore control over the session is to login from another machine, and run another Java app which calls Robot.mouseMove() - ick. Hopefully few people will encounter this bug, since Robot isn't used in conjuction w/ someone actually being at the console.
I've reproduced this w/ 1.3.1, 1.4, 1.4.1, and 1.4.2b18 on Solaris 9/Sparc, but not on Linux. I'm running Xinerama and I've only ever reproduced the problem when the Frame was on the second screen, so it may be related to Xinerama.
// Test behavior of getLocationOnScreen() for multimon situations
import java.awt.*;
import java.awt.event.*;
public class FrameLocOnScreen extends Frame implements ActionListener {
Button getLocBtn;
Button moveMouseBtn;
public FrameLocOnScreen() {
super("FrameLocOnScreen");
getLocBtn = new Button("Frame.getLocationOnScreen()");
getLocBtn.addActionListener(this);
moveMouseBtn = new Button("Robot.mouseMove()");
moveMouseBtn .addActionListener(this);
setLayout(new FlowLayout());
add(getLocBtn);
add(moveMouseBtn);
pack();
}
public static void main(String[] args) {
FrameLocOnScreen f = new FrameLocOnScreen();
f.show();
}
public void actionPerformed(ActionEvent e) {
Point loc = getLocationOnScreen();
if (e.getSource() == getLocBtn) {
System.out.println(loc);
}
else if (e.getSource() == moveMouseBtn) {
Robot robot;
try {
robot = new Robot();
}
catch (AWTException exc) {
System.out.println("Unable to create Robot");
return;
}
robot.mouseMove(loc.x, loc.y);
System.out.println("Moved mouse to " + loc);
}
}
}
At this point, you can move the mouse around and the cursor appears to move, but pressing the mouse button always acts like the mouse is at the right edge of the screen. This is especially frustrating when using point-to-focus, because I can't activate the terminal window in which I started the Java app to kill it. Sometimes, the only way to restore control over the session is to login from another machine, and run another Java app which calls Robot.mouseMove() - ick. Hopefully few people will encounter this bug, since Robot isn't used in conjuction w/ someone actually being at the console.
I've reproduced this w/ 1.3.1, 1.4, 1.4.1, and 1.4.2b18 on Solaris 9/Sparc, but not on Linux. I'm running Xinerama and I've only ever reproduced the problem when the Frame was on the second screen, so it may be related to Xinerama.
// Test behavior of getLocationOnScreen() for multimon situations
import java.awt.*;
import java.awt.event.*;
public class FrameLocOnScreen extends Frame implements ActionListener {
Button getLocBtn;
Button moveMouseBtn;
public FrameLocOnScreen() {
super("FrameLocOnScreen");
getLocBtn = new Button("Frame.getLocationOnScreen()");
getLocBtn.addActionListener(this);
moveMouseBtn = new Button("Robot.mouseMove()");
moveMouseBtn .addActionListener(this);
setLayout(new FlowLayout());
add(getLocBtn);
add(moveMouseBtn);
pack();
}
public static void main(String[] args) {
FrameLocOnScreen f = new FrameLocOnScreen();
f.show();
}
public void actionPerformed(ActionEvent e) {
Point loc = getLocationOnScreen();
if (e.getSource() == getLocBtn) {
System.out.println(loc);
}
else if (e.getSource() == moveMouseBtn) {
Robot robot;
try {
robot = new Robot();
}
catch (AWTException exc) {
System.out.println("Unable to create Robot");
return;
}
robot.mouseMove(loc.x, loc.y);
System.out.println("Moved mouse to " + loc);
}
}
}
- backported by
-
JDK-2163874 Mouse cursor can become "stuck" after using Robot.mouseMove()
- Closed