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) #elif defined(MOZ_WIDGET_QT)
#include <QX11Info> #include <QX11Info>
#elif defined(OS_WIN) #elif defined(OS_WIN)
#ifndef WM_MOUSEHWHEEL
#define WM_MOUSEHWHEEL 0x020E
#endif
#include "nsWindowsDllInterceptor.h" #include "nsWindowsDllInterceptor.h"
@ -1058,6 +1061,21 @@ PluginInstanceChild::PluginWindowProc(HWND hWnd,
if (message == WM_MOUSEACTIVATE) if (message == WM_MOUSEACTIVATE)
self->CallPluginGotFocus(); 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 && if (message == WM_USER+1 &&
(self->mQuirks & PluginInstanceChild::QUIRK_FLASH_THROTTLE_WMUSER_EVENTS)) { (self->mQuirks & PluginInstanceChild::QUIRK_FLASH_THROTTLE_WMUSER_EVENTS)) {
self->FlashThrottleMessage(hWnd, message, wParam, lParam, true); self->FlashThrottleMessage(hWnd, message, wParam, lParam, true);

View File

@ -66,9 +66,6 @@
using namespace mozilla::plugins; using namespace mozilla::plugins;
#if defined(XP_WIN) #if defined(XP_WIN)
#ifndef WM_MOUSEHWHEEL
#define WM_MOUSEHWHEEL 0x020E
#endif
const PRUnichar * kFlashFullscreenClass = L"ShockwaveFlashFullScreen"; const PRUnichar * kFlashFullscreenClass = L"ShockwaveFlashFullScreen";
#endif #endif
@ -1903,60 +1900,16 @@ PluginModuleChild::CallWindowProcHook(int nCode, WPARAM wParam, LPARAM lParam)
if (nCode >= 0 && if (nCode >= 0 &&
(InSendMessageEx(NULL)&(ISMEX_REPLIED|ISMEX_SEND)) == ISMEX_SEND) { (InSendMessageEx(NULL)&(ISMEX_REPLIED|ISMEX_SEND)) == ISMEX_SEND) {
CWPSTRUCT* pCwp = reinterpret_cast<CWPSTRUCT*>(lParam); CWPSTRUCT* pCwp = reinterpret_cast<CWPSTRUCT*>(lParam);
switch(pCwp->message) { if (pCwp->message == WM_KILLFOCUS) {
// Sync messages we can reply to: // Fix for flash fullscreen window loosing focus. On single
case WM_SETFOCUS: // core systems, sync killfocus events need to be handled
case WM_MOUSEHWHEEL: // after the flash fullscreen window procedure processes this
case WM_MOUSEWHEEL: // message, otherwise fullscreen focus will not work correctly.
case WM_HSCROLL: PRUnichar szClass[26];
case WM_VSCROLL: if (GetClassNameW(pCwp->hwnd, szClass,
case WM_CONTEXTMENU: sizeof(szClass)/sizeof(PRUnichar)) &&
case WM_IME_SETCONTEXT: !wcscmp(szClass, kFlashFullscreenClass)) {
case WM_WINDOWPOSCHANGED: gDelayFlashFocusReplyUntilEval = true;
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
} }
} }
} }