src/macosx/native/sun/awt/AWTWindow.m

Print this page

        

*** 938,955 **** */ JNIEXPORT void JNICALL Java_sun_lwawt_macosx_CPlatformWindow_nativeRevalidateNSWindowShadow (JNIEnv *env, jclass clazz, jlong windowPtr) { JNF_COCOA_ENTER(env); - AWT_ASSERT_NOT_APPKIT_THREAD; NSWindow *nsWindow = OBJC(windowPtr); [JNFRunLoop performOnMainThreadWaiting:NO withBlock:^(){ AWT_ASSERT_APPKIT_THREAD; [nsWindow invalidateShadow]; }]; JNF_COCOA_EXIT(env); } /* --- 938,960 ---- */ JNIEXPORT void JNICALL Java_sun_lwawt_macosx_CPlatformWindow_nativeRevalidateNSWindowShadow (JNIEnv *env, jclass clazz, jlong windowPtr) { JNF_COCOA_ENTER(env); NSWindow *nsWindow = OBJC(windowPtr); + if ([NSThread isMainThread]) { + AWT_ASSERT_APPKIT_THREAD; + [nsWindow invalidateShadow]; + } else { + AWT_ASSERT_NOT_APPKIT_THREAD; [JNFRunLoop performOnMainThreadWaiting:NO withBlock:^(){ AWT_ASSERT_APPKIT_THREAD; [nsWindow invalidateShadow]; }]; + } JNF_COCOA_EXIT(env); } /*