From: <eli...@us...> - 2007-05-31 21:00:14
|
Revision: 2835 http://svn.sourceforge.net/java-game-lib/?rev=2835&view=rev Author: elias_naur Date: 2007-05-31 14:00:13 -0700 (Thu, 31 May 2007) Log Message: ----------- Mac OS X: Don't use global is_grabbed variable in MacOSXMouseEventQueue.nWarpCursor Modified Paths: -------------- trunk/LWJGL/src/native/macosx/org_lwjgl_input_Mouse.c Modified: trunk/LWJGL/src/native/macosx/org_lwjgl_input_Mouse.c =================================================================== --- trunk/LWJGL/src/native/macosx/org_lwjgl_input_Mouse.c 2007-05-31 08:52:55 UTC (rev 2834) +++ trunk/LWJGL/src/native/macosx/org_lwjgl_input_Mouse.c 2007-05-31 21:00:13 UTC (rev 2835) @@ -44,18 +44,12 @@ #include "org_lwjgl_opengl_MacOSXMouseEventQueue.h" #include "common_tools.h" -static bool is_grabbed; - JNIEXPORT void JNICALL Java_org_lwjgl_opengl_MacOSXMouseEventQueue_nGrabMouse(JNIEnv *env, jclass unused, jboolean grab) { - bool new_grabbed = grab == JNI_TRUE; - if (is_grabbed != new_grabbed) { - is_grabbed = new_grabbed; - CGAssociateMouseAndMouseCursorPosition(is_grabbed ? FALSE : TRUE); - if (is_grabbed) - CGDisplayHideCursor(kCGDirectMainDisplay); - else - CGDisplayShowCursor(kCGDirectMainDisplay); - } + CGAssociateMouseAndMouseCursorPosition(grab == JNI_TRUE ? FALSE : TRUE); + if (grab) + CGDisplayHideCursor(kCGDirectMainDisplay); + else + CGDisplayShowCursor(kCGDirectMainDisplay); } JNIEXPORT void JNICALL Java_org_lwjgl_opengl_MacOSXMouseEventQueue_nWarpCursor(JNIEnv *env, jclass unused, jint x, jint y) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |