Fixed AWTUtil.setCursorPosition. Added check to LinuxAWTInput.
This commit is contained in:
parent
b449fff026
commit
4c5a2fe644
|
@ -108,8 +108,9 @@ final class AWTUtil {
|
|||
|
||||
public static void setCursorPosition(Component component, Robot robot, int x, int y) {
|
||||
if (robot != null) {
|
||||
int transformed_x = component.getX() + x;
|
||||
int transformed_y = component.getY() + component.getHeight() - 1 - y;
|
||||
Point location = component.getLocationOnScreen();
|
||||
int transformed_x = location.x + x;
|
||||
int transformed_y = location.y + component.getHeight() - 1 - y;
|
||||
robot.mouseMove(transformed_x, transformed_y);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -117,7 +117,7 @@ final class LinuxAWTInput extends AbstractAWTInput {
|
|||
try {
|
||||
LinuxPeerInfo linux_peer_info = (LinuxPeerInfo)peer_info;
|
||||
long new_window = linux_peer_info.getDrawable();
|
||||
if (new_window != cached_window) {
|
||||
if (cached_mouse == null || new_window != cached_window) {
|
||||
ungrabInput();
|
||||
cached_window = new_window;
|
||||
try {
|
||||
|
|
|
@ -321,7 +321,7 @@ final class MacOSXDisplay implements DisplayImplementation {
|
|||
}
|
||||
|
||||
public void setCursorPosition(int x, int y) {
|
||||
AWTUtil.setCursorPosition(frame, robot, x, y);
|
||||
AWTUtil.setCursorPosition(frame.getCanvas(), robot, x, y);
|
||||
}
|
||||
|
||||
public void setNativeCursor(Object handle) throws LWJGLException {
|
||||
|
|
Loading…
Reference in New Issue