From 9bea7f371d272d8cd7fb86ff0d1ffdd404f8a37a Mon Sep 17 00:00:00 2001 From: Masayuki Nakano Date: Mon, 10 Aug 2015 23:54:18 +0900 Subject: [PATCH] Bug 1187724 Don't dispatch KeyboardEvents when the target of WM_APPCOMMAND is a windowed plug-in for preventing deadlock r=jimm --- widget/windows/KeyboardLayout.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/widget/windows/KeyboardLayout.cpp b/widget/windows/KeyboardLayout.cpp index fb86539f79b4..70d90d0cd55f 100644 --- a/widget/windows/KeyboardLayout.cpp +++ b/widget/windows/KeyboardLayout.cpp @@ -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(mMsg.wParam)); + } bool consumed = false;