src/macosx/native/sun/java2d/opengl/CGLLayer.m

Print this page

        

@@ -214,10 +214,10 @@
 Java_sun_java2d_opengl_CGLLayer_nativeSetScale
 (JNIEnv *env, jclass cls, jlong layerPtr, jdouble scale)
 {
     JNF_COCOA_ENTER(env);
     CGLLayer *layer = jlong_to_ptr(layerPtr);
-    [ThreadUtilities performOnMainThreadWaiting:NO block:^(){
+    [ThreadUtilities performOnMainThreadWaiting:[NSThread isMainThread] block:^(){
         layer.contentsScale = scale;
     }];
     JNF_COCOA_EXIT(env);
 }