Bug 1140183 - Don't enter safe mode on opt/shift if environment variable MOZ_DISABLE_SAFE_MODE_KEY is set. r=ehsan

This commit is contained in:
Jesse Ruderman 2015-03-06 04:27:32 -08:00
parent abdb457e97
commit 19a6d230a6

View File

@ -3304,14 +3304,17 @@ XREMain::XRE_mainInit(bool* aExitFlag)
// order bit will be 1 if the key is pressed. By masking the returned short
// with 0x8000 the result will be 0 if the key is not pressed and non-zero
// otherwise.
if (GetKeyState(VK_SHIFT) & 0x8000 &&
!(GetKeyState(VK_CONTROL) & 0x8000) && !(GetKeyState(VK_MENU) & 0x8000)) {
if ((GetKeyState(VK_SHIFT) & 0x8000) &&
!(GetKeyState(VK_CONTROL) & 0x8000) &&
!(GetKeyState(VK_MENU) & 0x8000) &&
!EnvHasValue("MOZ_DISABLE_SAFE_MODE_KEY")) {
gSafeMode = true;
}
#endif
#ifdef XP_MACOSX
if (GetCurrentEventKeyModifiers() & optionKey)
if ((GetCurrentEventKeyModifiers() & optionKey) &&
!EnvHasValue("MOZ_DISABLE_SAFE_MODE_KEY"))
gSafeMode = true;
#endif