mirror of
https://github.com/ONLYOFFICE/desktop-sdk.git
synced 2026-03-31 10:23:12 +08:00
Remove IsMainProcess method from CefApplication & add Prepare method (#82)
This commit is contained in:
@ -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;
|
||||
};
|
||||
|
||||
@ -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
|
||||
|
||||
Reference in New Issue
Block a user