Bug 1187724 Don't dispatch KeyboardEvents when the target of WM_APPCOMMAND is a windowed plug-in for preventing deadlock r=jimm

This commit is contained in:
Masayuki Nakano 2015-08-10 23:54:18 +09:00
parent 6cfdf70c9e
commit 9bea7f371d

View File

@ -1296,6 +1296,14 @@ NativeKey::HandleAppCommandMessage() const
// This allow web applications to provide better UX for multimedia keyboard
// users.
bool dispatchKeyEvent = (GET_DEVICE_LPARAM(mMsg.lParam) == FAPPCOMMAND_KEY);
if (dispatchKeyEvent) {
// If a plug-in window has focus but it didn't consume the message, our
// window receive WM_APPCOMMAND message. In this case, we shouldn't
// dispatch KeyboardEvents because an event handler may access the
// plug-in process synchronously.
dispatchKeyEvent =
WinUtils::IsOurProcessWindow(reinterpret_cast<HWND>(mMsg.wParam));
}
bool consumed = false;