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.
This commit is contained in:
kappaOne 2013-10-27 21:28:11 +00:00
parent 5fb66cce46
commit 46cbd89430
1 changed files with 7 additions and 2 deletions

View File

@ -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 */