From b449fff0268307b183613a57143cf3dd14275e7a Mon Sep 17 00:00:00 2001 From: Elias Naur Date: Fri, 27 Oct 2006 08:15:31 +0000 Subject: [PATCH] Mac OS X: Fixed cursor warping coordinates --- src/java/org/lwjgl/opengl/MacOSXMouseEventQueue.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/java/org/lwjgl/opengl/MacOSXMouseEventQueue.java b/src/java/org/lwjgl/opengl/MacOSXMouseEventQueue.java index ad32b78c..0b6676a4 100644 --- a/src/java/org/lwjgl/opengl/MacOSXMouseEventQueue.java +++ b/src/java/org/lwjgl/opengl/MacOSXMouseEventQueue.java @@ -43,6 +43,7 @@ import java.awt.event.MouseWheelEvent; import java.awt.event.MouseWheelListener; import java.awt.Component; import java.awt.Rectangle; +import java.awt.Point; import java.nio.ByteBuffer; import java.nio.IntBuffer; @@ -84,8 +85,9 @@ final class MacOSXMouseEventQueue extends MouseEventQueue { void warpCursor() { if (isGrabbed()) { Rectangle bounds = getComponent().getBounds(); - int x = bounds.x + bounds.width/2; - int y = bounds.y + bounds.height/2; + Point location_on_screen = getComponent().getLocationOnScreen(); + int x = location_on_screen.x + bounds.width/2; + int y = location_on_screen.y + bounds.height/2; nWarpCursor(x, y); } }