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
--- a/widget/windows/nsWindow.cpp
+++ b/widget/windows/nsWindow.cpp
@@ -6497,17 +6497,25 @@ LRESULT nsWindow::ProcessCharMessage(con
NativeKey nativeKey(this, aMsg, modKeyState);
return static_cast<LRESULT>(nativeKey.HandleCharMessage(aEventDispatched));
}
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,
bool *aEventDispatched)
{
// If this method doesn't call NativeKey::HandleKeyDownMessage(), this method
// must clean up the redirected message information itself. For more
// information, see above comment of