changeset 10712:a1b163779415

8039926: -spash:<image> can't be combined with -xStartOnFirstThread since JDK 7 Reviewed-by: anthony, azvegint
author pchelko
date Mon, 30 Mar 2015 17:03:56 +0400
parents fdbc5637a8c4
children f8c771c61ff2
files src/macosx/native/sun/awt/splashscreen/splashscreen_sys.m
diffstat 1 files changed, 10 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/macosx/native/sun/awt/splashscreen/splashscreen_sys.m	Mon Mar 30 17:50:59 2015 +0900
+++ b/src/macosx/native/sun/awt/splashscreen/splashscreen_sys.m	Mon Mar 30 17:03:56 2015 +0400
@@ -176,9 +176,16 @@
     splash->screenFormat.byteOrder = 1 ?  BYTE_ORDER_LSBFIRST : BYTE_ORDER_MSBFIRST;
     splash->screenFormat.depthBytes = 4;
 
-    [JNFRunLoop performOnMainThreadWaiting:NO withBlock:^() {
-        [NSApplicationAWT runAWTLoopWithApp:[NSApplicationAWT sharedApplication]];
-    }];
+    // If this property is present we are running SWT and should not start a runLoop
+    // Can't check if running SWT in webstart, so splash screen in webstart SWT
+    // applications is not supported
+    char envVar[80];
+    snprintf(envVar, sizeof(envVar), "JAVA_STARTED_ON_FIRST_THREAD_%d", getpid());
+    if (getenv(envVar) == NULL) {
+        [JNFRunLoop performOnMainThreadWaiting:NO withBlock:^() {
+            [NSApplicationAWT runAWTLoopWithApp:[NSApplicationAWT sharedApplication]];
+        }];
+    }
 }
 
 void