removed restriction about native cursors, and fixed mouse not showing on setNativeCursor(null);
This commit is contained in:
parent
e034c76f19
commit
84eae4c6f6
|
@ -244,8 +244,7 @@ JNIEXPORT void JNICALL Java_org_lwjgl_input_Mouse_nSetNativeCursor
|
||||||
} else {
|
} else {
|
||||||
if (usingNativeCursor) {
|
if (usingNativeCursor) {
|
||||||
SetClassLong(hwnd, GCL_HCURSOR, (LONG)NULL);
|
SetClassLong(hwnd, GCL_HCURSOR, (LONG)NULL);
|
||||||
SetCursor(NULL);
|
SetCursor(LoadCursor(NULL, IDC_ARROW));
|
||||||
ShowCursor(TRUE);
|
|
||||||
mDIDevice->Unacquire();
|
mDIDevice->Unacquire();
|
||||||
if(mDIDevice->SetCooperativeLevel(hwnd, mouseMask) != DI_OK) {
|
if(mDIDevice->SetCooperativeLevel(hwnd, mouseMask) != DI_OK) {
|
||||||
throwException(env, "Could not set the CooperativeLevel.");
|
throwException(env, "Could not set the CooperativeLevel.");
|
||||||
|
@ -253,6 +252,7 @@ JNIEXPORT void JNICALL Java_org_lwjgl_input_Mouse_nSetNativeCursor
|
||||||
}
|
}
|
||||||
usingNativeCursor = false;
|
usingNativeCursor = false;
|
||||||
mDIDevice->Acquire();
|
mDIDevice->Acquire();
|
||||||
|
ShowCursor(TRUE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -305,9 +305,6 @@ JNIEXPORT void JNICALL Java_org_lwjgl_input_Mouse_nPoll(JNIEnv * env, jclass cla
|
||||||
*/
|
*/
|
||||||
JNIEXPORT void JNICALL Java_org_lwjgl_input_Mouse_nGrabMouse
|
JNIEXPORT void JNICALL Java_org_lwjgl_input_Mouse_nGrabMouse
|
||||||
(JNIEnv * env, jclass clazz, jboolean grab) {
|
(JNIEnv * env, jclass clazz, jboolean grab) {
|
||||||
if(usingNativeCursor) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(grab) {
|
if(grab) {
|
||||||
mouseMask = DISCL_EXCLUSIVE | DISCL_FOREGROUND;
|
mouseMask = DISCL_EXCLUSIVE | DISCL_FOREGROUND;
|
||||||
|
|
Loading…
Reference in New Issue