소스 검색

[Windows] Open a new console window for the editor instances.

bruvzg 3 년 전
부모
커밋
6ee48afb4e
1개의 변경된 파일3개의 추가작업 그리고 0개의 파일을 삭제
  1. 3 0
      platform/windows/os_windows.cpp

+ 3 - 0
platform/windows/os_windows.cpp

@@ -484,6 +484,9 @@ Error OS_Windows::create_process(const String &p_path, const List<String> &p_arg
 #ifndef DEBUG_ENABLED
 	dwCreationFlags |= CREATE_NO_WINDOW;
 #endif
+	if (p_path == get_executable_path() && GetConsoleWindow() != nullptr) {
+		dwCreationFlags |= CREATE_NEW_CONSOLE;
+	}
 
 	int ret = CreateProcessW(nullptr, (LPWSTR)(command.utf16().ptrw()), nullptr, nullptr, false, dwCreationFlags, nullptr, nullptr, si_w, &pi.pi);
 	ERR_FAIL_COND_V_MSG(ret == 0, ERR_CANT_FORK, "Could not create child process: " + command);