зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1355147 - Change Firefox to a background application when headless. r=mstange
To avoid headless Firefox creating an icon in the dock and taking focus away from the terminal, it is now changed to a background app on startup. MozReview-Commit-ID: DyKk0Zxq0Uq
This commit is contained in:
Родитель
465c6d492e
Коммит
c518d17f15
|
@ -3178,6 +3178,18 @@ XREMain::XRE_mainInit(bool* aExitFlag)
|
|||
Output(true, "Error: headless mode is not currently supported on this platform.\n");
|
||||
return 1;
|
||||
#endif
|
||||
|
||||
#ifdef XP_MACOSX
|
||||
// To avoid taking focus when running in headless mode immediately
|
||||
// transition Firefox to a background application.
|
||||
ProcessSerialNumber psn = { 0, kCurrentProcess };
|
||||
OSStatus transformStatus = TransformProcessType(&psn, kProcessTransformToBackgroundApplication);
|
||||
if (transformStatus != noErr) {
|
||||
NS_ERROR("Failed to make process a background application.");
|
||||
return 1;
|
||||
}
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
nsresult rv;
|
||||
|
|
Загрузка…
Ссылка в новой задаче