Bug 1382199: On Windows, prevent the System menu bar from triggering when F10 is released. r=jimm

Windows default behavior will trigger the System menu bar when F10 is released.
Among other things, this causes the System menu bar to appear when a web page overrides the contextmenu event.
We *never* want this default behavior, so eat this key (never pass it to Windows).

MozReview-Commit-ID: 4fWOuj4mWvW

--HG--
extra : rebase_source : 45d38ba19b2f23aca74a60819c7d93af2ffa167d
This commit is contained in:
James Teh 2018-02-16 12:08:58 +10:00
Родитель cf9f78f407
Коммит 0c2a975587
1 изменённых файлов: 9 добавлений и 1 удалений

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

@ -6502,7 +6502,15 @@ LRESULT nsWindow::ProcessKeyUpMessage(const MSG &aMsg, bool *aEventDispatched)
{
ModifierKeyState modKeyState;
NativeKey nativeKey(this, aMsg, modKeyState);
return static_cast<LRESULT>(nativeKey.HandleKeyUpMessage(aEventDispatched));
bool result = nativeKey.HandleKeyUpMessage(aEventDispatched);
if (aMsg.wParam == VK_F10) {
// Bug 1382199: Windows default behavior will trigger the System menu bar
// when F10 is released. Among other things, this causes the System menu bar
// to appear when a web page overrides the contextmenu event. We *never*
// want this default behavior, so eat this key (never pass it to Windows).
return true;
}
return result;
}
LRESULT nsWindow::ProcessKeyDownMessage(const MSG &aMsg,