IDEA-145463 Weird splash screen animation on startup
authorAnton Tarasov <anton.tarasov@jetbrains.com>
Fri, 29 Jan 2016 14:50:31 +0000 (17:50 +0300)
committerAnton Tarasov <anton.tarasov@jetbrains.com>
Fri, 29 Jan 2016 15:06:19 +0000 (18:06 +0300)
bin/WinLauncher/WinLauncher.exe
bin/WinLauncher/WinLauncher64.exe
native/WinLauncher/WinLauncher/WinLauncher.cpp

index 974e6d495bbef3e7d0f34e502f9ea1c228db15c9..6cb990da36312b24295eb642b2b5342042fc164b 100644 (file)
Binary files a/bin/WinLauncher/WinLauncher.exe and b/bin/WinLauncher/WinLauncher.exe differ
index 63f5d186bd9c0c1c5d740b6eb3a9575389b3a198..4873c35f883235e0f3a630cc466945adf3179b9a 100644 (file)
Binary files a/bin/WinLauncher/WinLauncher64.exe and b/bin/WinLauncher/WinLauncher64.exe differ
index 1b5ca086b5935daf535b5ac09f31387b5a6beffb..93c03bd7a2dc187d3f7987512473c24aabcd23da 100644 (file)
@@ -29,6 +29,7 @@ JNI_createJavaVM pCreateJavaVM = NULL;
 JavaVM* jvm = NULL;
 JNIEnv* env = NULL;
 volatile bool terminating = false;
+bool nativesplash = false;
 
 HANDLE hFileMapping;
 HANDLE hEvent;
@@ -541,11 +542,12 @@ jobjectArray PrepareCommandLine()
   int numArgs;
   LPWSTR* argv = CommandLineToArgvW(GetCommandLineW(), &numArgs);
   jclass stringClass = env->FindClass("java/lang/String");
-  jobjectArray args = env->NewObjectArray(numArgs - 1, stringClass, NULL);
-  for (int i = 1; i < numArgs; i++)
+  jobjectArray args = env->NewObjectArray(numArgs - (nativesplash ? 2 : 1), stringClass, NULL);
+  for (int i = 1, k = 0; i < numArgs; i++)
   {
     const wchar_t* arg = argv[i];
-    env->SetObjectArrayElement(args, i - 1, env->NewString((const jchar *)arg, wcslen(argv[i])));
+    if (_wcsicmp(arg, _T("/nativesplash")) == 0) continue;
+    env->SetObjectArrayElement(args, k++, env->NewString((const jchar *)arg, wcslen(argv[i])));
   }
   return args;
 }
@@ -850,7 +852,7 @@ int APIENTRY _tWinMain(HINSTANCE hInstance,
 
   if (!CheckSingleInstance()) return 1;
 
-  if (wcsstr(lpCmdLine, _T("nosplash")) == NULL) StartSplashProcess();
+  if (nativesplash = wcsstr(lpCmdLine, _T("/nativesplash")) != NULL) StartSplashProcess();
 
   if (!LocateJVM()) return 1;
   if (!LoadVMOptions()) return 1;