Bug 864940 - Only hand off focus rights to explorer if the test console has focus. r=bbondy

This commit is contained in:
Jim Mathies 2013-05-09 13:37:41 -05:00
Родитель d94f23379f
Коммит d866f0cf8a
1 изменённых файлов: 9 добавлений и 6 удалений

Просмотреть файл

@ -219,12 +219,15 @@ static bool Launch()
}
Log(L"App model id='%s'", appModelID);
// Hand off focus rights to the out-of-process activation server. Without
// this the metro interface won't launch.
hr = CoAllowSetForegroundWindow(activateMgr, NULL);
if (FAILED(hr)) {
Fail(L"CoAllowSetForegroundWindow result %X", hr);
return false;
// Hand off focus rights if the terminal has focus to the out-of-process
// activation server (explorer.exe). Without this the metro interface
// won't launch.
if (GetForegroundWindow() == GetConsoleWindow()) {
hr = CoAllowSetForegroundWindow(activateMgr, NULL);
if (FAILED(hr)) {
Fail(L"CoAllowSetForegroundWindow result %X", hr);
return false;
}
}
Log(L"Harness process id: %d", GetCurrentProcessId());