Fix a native crash on startup of some applications

This commit is contained in:
kappa1 2012-11-03 18:06:08 +00:00
parent 460b6f05dd
commit 94c23298c8
2 changed files with 4 additions and 4 deletions

View File

@ -497,7 +497,7 @@ JNIEXPORT void JNICALL Java_org_lwjgl_opengl_MacOSXDisplay_nHideUI(JNIEnv *env,
}
MacOSXWindowInfo *window_info = (MacOSXWindowInfo *)(*env)->GetDirectBufferAddress(env, window_handle);
if(floor(NSAppKitVersionNumber) > NSAppKitVersionNumber10_5) {
//if(floor(NSAppKitVersionNumber) > NSAppKitVersionNumber10_5) {
/*NSApplicationPresentationOptions options = NSApplicationPresentationDefault;
if (hide == JNI_TRUE) {
options = NSApplicationPresentationFullScreen; // this requires OS X 10.7+ to compile
@ -509,11 +509,11 @@ JNIEXPORT void JNICALL Java_org_lwjgl_opengl_MacOSXDisplay_nHideUI(JNIEnv *env,
if (window_info->window != nil) {
[[NSApplication sharedApplication] setPresentationOptions:options];
}*/
} else {
//} else {
if (hide == JNI_TRUE) {
SetSystemUIMode(kUIModeContentSuppressed, 0);
} else {
SetSystemUIMode(kUIModeNormal, 0);
}
}
//}
}

View File

@ -58,7 +58,7 @@ JNIEXPORT jobject JNICALL Java_org_lwjgl_opengl_MacOSXContextImplementation_nCre
MacOSXContext *shared_context_info;
MacOSXContext *context_info;
NSOpenGLContext *context;
NSOpenGLContext *shared_context;
NSOpenGLContext *shared_context = NULL;
printf("nCreate\n");
jobject context_handle = newJavaManagedByteBuffer(env, sizeof(MacOSXContext));
if (context_handle == NULL) {