src/java.desktop/macosx/native/libawt_lwawt/awt/LWCToolkit.m

Print this page

        

@@ -604,10 +604,27 @@
 JNF_COCOA_EXIT(env);
 
     return active;
 }
 
+/*
+ * Class:     sun_lwawt_macosx_LWCToolkit
+ * Method:    activateApplication
+ * Signature: ()V
+ */
+JNIEXPORT void JNICALL Java_sun_lwawt_macosx_LWCToolkit_activateApplication
+(JNIEnv *env, jclass clazz)
+{
+    JNF_COCOA_ENTER(env);
+    [ThreadUtilities performOnMainThreadWaiting:NO block:^(){
+        if(![NSApp isActive]){
+            [NSApp activateIgnoringOtherApps:YES];
+        }
+    }];
+    JNF_COCOA_EXIT(env);
+}
+
 
 /*
  * Class:     sun_awt_SunToolkit
  * Method:    closeSplashScreen
  * Signature: ()V