From 46cbd89430320b24792a1fda2d7ac8e64bec04bd Mon Sep 17 00:00:00 2001 From: kappaOne Date: Sun, 27 Oct 2013 21:28:11 +0000 Subject: [PATCH] Remove dependencies on AWT inside the Cursor.getMaxCursorSize() and Cursor.getMinCursorSize() methods. Fixes a crash on OS X 10.9, thx to nbf for finding and reporting. --- src/java/org/lwjgl/opengl/MacOSXDisplay.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/java/org/lwjgl/opengl/MacOSXDisplay.java b/src/java/org/lwjgl/opengl/MacOSXDisplay.java index 2678300f..0bb25c4f 100644 --- a/src/java/org/lwjgl/opengl/MacOSXDisplay.java +++ b/src/java/org/lwjgl/opengl/MacOSXDisplay.java @@ -53,6 +53,8 @@ import java.util.ArrayList; import java.util.List; import org.lwjgl.input.Cursor; +import org.lwjgl.opengl.Display; +import org.lwjgl.opengl.DisplayMode; import org.lwjgl.BufferUtils; import org.lwjgl.MemoryUtil; import org.lwjgl.LWJGLException; @@ -434,11 +436,14 @@ final class MacOSXDisplay implements DisplayImplementation { } public int getMinCursorSize() { - return AWTUtil.getMinCursorSize(); + return 1; } public int getMaxCursorSize() { - return AWTUtil.getMaxCursorSize(); + // as there is no max cursor size limit on OS X + // return the max cursor size as half the screen resolution + DisplayMode dm = Display.getDesktopDisplayMode(); + return Math.min(dm.getWidth(), dm.getHeight()) / 2; } /* Keyboard */