Bug 566610 - Undo the nuclear reply message option, keep the set focus fix. r=bent.

This commit is contained in:
Jim Mathies 2010-05-18 13:17:10 -05:00
parent 886325df00
commit 54c35c09df
2 changed files with 28 additions and 57 deletions

View File

@ -59,6 +59,9 @@ using namespace mozilla::plugins;
#elif defined(MOZ_WIDGET_QT)
#include <QX11Info>
#elif defined(OS_WIN)
#ifndef WM_MOUSEHWHEEL
#define WM_MOUSEHWHEEL 0x020E
#endif
#include "nsWindowsDllInterceptor.h"
@ -1058,6 +1061,21 @@ PluginInstanceChild::PluginWindowProc(HWND hWnd,
if (message == WM_MOUSEACTIVATE)
self->CallPluginGotFocus();
// Prevent lockups due to plugins making rpc calls when the parent
// is making a synchronous SendMessage call to the child window. Add
// more messages as needed.
if ((InSendMessageEx(NULL)&(ISMEX_REPLIED|ISMEX_SEND)) == ISMEX_SEND) {
switch(message) {
case WM_KILLFOCUS:
case WM_MOUSEHWHEEL:
case WM_MOUSEWHEEL:
case WM_HSCROLL:
case WM_VSCROLL:
ReplyMessage(0);
break;
}
}
if (message == WM_USER+1 &&
(self->mQuirks & PluginInstanceChild::QUIRK_FLASH_THROTTLE_WMUSER_EVENTS)) {
self->FlashThrottleMessage(hWnd, message, wParam, lParam, true);

View File

@ -66,9 +66,6 @@
using namespace mozilla::plugins;
#if defined(XP_WIN)
#ifndef WM_MOUSEHWHEEL
#define WM_MOUSEHWHEEL 0x020E
#endif
const PRUnichar * kFlashFullscreenClass = L"ShockwaveFlashFullScreen";
#endif
@ -1903,60 +1900,16 @@ PluginModuleChild::CallWindowProcHook(int nCode, WPARAM wParam, LPARAM lParam)
if (nCode >= 0 &&
(InSendMessageEx(NULL)&(ISMEX_REPLIED|ISMEX_SEND)) == ISMEX_SEND) {
CWPSTRUCT* pCwp = reinterpret_cast<CWPSTRUCT*>(lParam);
switch(pCwp->message) {
// Sync messages we can reply to:
case WM_SETFOCUS:
case WM_MOUSEHWHEEL:
case WM_MOUSEWHEEL:
case WM_HSCROLL:
case WM_VSCROLL:
case WM_CONTEXTMENU:
case WM_IME_SETCONTEXT:
case WM_WINDOWPOSCHANGED:
ReplyMessage(0);
break;
case WM_KILLFOCUS:
{
// Fix for flash fullscreen window loosing focus. On single
// core systems, sync killfocus events need to be handled
// after the flash fullscreen window procedure processes this
// message, otherwise fullscreen focus will not work correctly.
PRUnichar szClass[26];
if (GetClassNameW(pCwp->hwnd, szClass,
sizeof(szClass)/sizeof(PRUnichar)) &&
!wcscmp(szClass, kFlashFullscreenClass)) {
gDelayFlashFocusReplyUntilEval = true;
}
else {
ReplyMessage(0);
}
}
break;
// Sync message that can't be handled:
case WM_WINDOWPOSCHANGING:
case WM_DESTROY:
case WM_PAINT:
break;
// Everything else:
default: {
#ifdef DEBUG
nsCAutoString log("Child plugin module received untrapped ");
log.AppendLiteral("synchronous message for window. msg=");
char szTmp[40];
sprintf(szTmp, "0x%06X", pCwp->message);
log.Append(szTmp);
log.AppendLiteral(" hwnd=");
sprintf(szTmp, "0x%08X", pCwp->hwnd);
log.Append(szTmp);
PRUnichar className[256] = { 0 };
if (GetClassNameW(pCwp->hwnd, className,
sizeof(className)/sizeof(PRUnichar)) > 0) {
log.AppendLiteral(" class='");
log.Append(NS_ConvertUTF16toUTF8((PRUnichar*)className));
log.AppendLiteral("'");
}
NS_WARNING(log.get());
#endif
if (pCwp->message == WM_KILLFOCUS) {
// Fix for flash fullscreen window loosing focus. On single
// core systems, sync killfocus events need to be handled
// after the flash fullscreen window procedure processes this
// message, otherwise fullscreen focus will not work correctly.
PRUnichar szClass[26];
if (GetClassNameW(pCwp->hwnd, szClass,
sizeof(szClass)/sizeof(PRUnichar)) &&
!wcscmp(szClass, kFlashFullscreenClass)) {
gDelayFlashFocusReplyUntilEval = true;
}
}
}