Remove IsMainProcess method from CefApplication & add Prepare method (#82)

This commit is contained in:
Oleg Korshul
2020-03-02 11:19:24 +03:00
committed by GitHub
parent 1272882ec1
commit cb6cfa6283
2 changed files with 4 additions and 18 deletions

View File

@ -56,7 +56,7 @@ public:
bool IsChromiumSubprocess();
static bool IsMainProcess(int argc = 0, char* argv[] = NULL);
static void Prepare(int argc = 0, char* argv[] = NULL);
friend class CAscApplicationManager;
};

View File

@ -556,25 +556,11 @@ bool CApplicationCEF::IsChromiumSubprocess()
return (m_pInternal->m_nReturnCodeInitCef >= 0) ? true : false;
}
bool CApplicationCEF::IsMainProcess(int argc, char* argv[])
void CApplicationCEF::Prepare(int argc, char* argv[])
{
bool bIsMain = true;
#ifdef WIN32
std::string sCommandLine = GetCommandLineA();
if (sCommandLine.find("--type") != std::string::npos)
bIsMain = false;
#else
for (int i = 0; i < argc; ++i)
{
std::string sCommandLine(argv[i]);
if (sCommandLine.find("--type") != std::string::npos)
{
bIsMain = false;
break;
}
}
#if defined(_LINUX) && !defined(_MAC)
NSSystem::SetEnvValueA("GDK_BACKEND", "x11");
#endif
return bIsMain;
}
// External message loop