From aab9bcc0423a04b670538fb5bc55ecaa767d6917 Mon Sep 17 00:00:00 2001 From: Petr Pchelko Date: Thu, 17 Apr 2014 16:26:45 +0400 Subject: [PATCH] 8039926: -spash: can't be combined with -xStartOnFirstThread since JDK 7 Reviewed-by: anthony, azvegint --- .../native/sun/awt/splashscreen/splashscreen_sys.m | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/jdk/src/macosx/native/sun/awt/splashscreen/splashscreen_sys.m b/jdk/src/macosx/native/sun/awt/splashscreen/splashscreen_sys.m index 40f380bdeb1..40635670b26 100644 --- a/jdk/src/macosx/native/sun/awt/splashscreen/splashscreen_sys.m +++ b/jdk/src/macosx/native/sun/awt/splashscreen/splashscreen_sys.m @@ -142,9 +142,16 @@ SplashInitPlatform(Splash * splash) { 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