зеркало из https://github.com/mozilla/gecko-dev.git
Bug 932664 - Link clicks and file activations should open in the currently opened browser no matter which environment. r=bbondy
This commit is contained in:
Родитель
ef2d108ec4
Коммит
2c9be184f9
|
@ -81,7 +81,7 @@ IsImmersiveProcessDynamic(HANDLE process)
|
|||
}
|
||||
|
||||
bool
|
||||
IsImmersiveProcessRunning(const wchar_t *processName)
|
||||
IsProcessRunning(const wchar_t *processName, bool bCheckIfMetro)
|
||||
{
|
||||
bool exists = false;
|
||||
PROCESSENTRY32W entry;
|
||||
|
@ -93,7 +93,9 @@ IsImmersiveProcessRunning(const wchar_t *processName)
|
|||
while (!exists && Process32Next(snapshot, &entry)) {
|
||||
if (!_wcsicmp(entry.szExeFile, processName)) {
|
||||
HANDLE process = OpenProcess(GENERIC_READ, FALSE, entry.th32ProcessID);
|
||||
if (IsImmersiveProcessDynamic(process)) {
|
||||
bool isImmersiveProcess = IsImmersiveProcessDynamic(process);
|
||||
if ((bCheckIfMetro && isImmersiveProcess) ||
|
||||
(!bCheckIfMetro && !isImmersiveProcess)) {
|
||||
exists = true;
|
||||
}
|
||||
CloseHandle(process);
|
||||
|
|
|
@ -28,4 +28,4 @@ bool IsDX10Available();
|
|||
bool GetDWORDRegKey(LPCWSTR name, DWORD &value);
|
||||
bool SetDWORDRegKey(LPCWSTR name, DWORD value);
|
||||
bool IsImmersiveProcessDynamic(HANDLE process);
|
||||
bool IsImmersiveProcessRunning(const wchar_t *processName);
|
||||
bool IsProcessRunning(const wchar_t *processName, bool bCheckIfMetro);
|
||||
|
|
|
@ -265,6 +265,14 @@ public:
|
|||
*aLaunchType = AHE_DESKTOP;
|
||||
mIsDesktopRequest = true;
|
||||
|
||||
if (!mIsRestartMetroRequest && IsProcessRunning(kFirefoxExe, false)) {
|
||||
return S_OK;
|
||||
} else if (!mIsRestartDesktopRequest && IsProcessRunning(kMetroFirefoxExe, true)) {
|
||||
*aLaunchType = AHE_IMMERSIVE;
|
||||
mIsDesktopRequest = false;
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
if (!mUnkSite) {
|
||||
Log(L"No mUnkSite.");
|
||||
return S_OK;
|
||||
|
@ -684,7 +692,7 @@ DelayedExecuteThread(LPVOID param)
|
|||
|
||||
size_t currentWaitTime = 0;
|
||||
while(currentWaitTime < RESTART_WAIT_TIMEOUT) {
|
||||
if (!IsImmersiveProcessRunning(kMetroFirefoxExe))
|
||||
if (!IsProcessRunning(kMetroFirefoxExe, true))
|
||||
break;
|
||||
currentWaitTime += RESTART_WAIT_PER_RETRY;
|
||||
Sleep(RESTART_WAIT_PER_RETRY);
|
||||
|
|
|
@ -225,6 +225,7 @@ MetroAppShell::Run(void)
|
|||
sinfo.fMask = SEE_MASK_FLAG_LOG_USAGE;
|
||||
sinfo.lpFile = L"http://-desktop";
|
||||
sinfo.lpVerb = L"open";
|
||||
sinfo.lpParameters = L"--desktop-restart";
|
||||
sinfo.nShow = SW_SHOWNORMAL;
|
||||
ShellExecuteEx(&sinfo);
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче