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

Print this page

        

@@ -939,18 +939,21 @@
  */
 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);
+    if ([NSThread isMainThread]) {
+        [nsWindow invalidateShadow];
+    } else {
     [JNFRunLoop performOnMainThreadWaiting:NO withBlock:^(){
         AWT_ASSERT_APPKIT_THREAD;
 
         [nsWindow invalidateShadow];
     }];
+    }
 
 JNF_COCOA_EXIT(env);
 }
 
 /*