Bug 543788 - Infinite loop in CallUpdateWindow/WM_PAINT messages when switching tabs with a windowed plugin (Acrobat and sometimes Flash), r=jimm
authorBenjamin Smedberg <benjamin@smedbergs.us>
Tue, 09 Feb 2010 11:57:03 -0500
changeset 46643 1666292c7610900bc6d21624d66a4f5f95cf7ce1
parent 46642 a77f5a6cce34dece7c0b90275001fa35b80465de
child 46644 28420868f2394cbebb4568e892222a8ea8004683
push id1
push userroot
push dateMon, 20 Oct 2014 17:29:22 +0000
reviewersjimm
bugs543788
milestone1.9.3a2pre
Bug 543788 - Infinite loop in CallUpdateWindow/WM_PAINT messages when switching tabs with a windowed plugin (Acrobat and sometimes Flash), r=jimm
ipc/glue/WindowsMessageLoop.cpp
widget/src/windows/nsWindowGfx.cpp
--- a/ipc/glue/WindowsMessageLoop.cpp
+++ b/ipc/glue/WindowsMessageLoop.cpp
@@ -252,16 +252,18 @@ ProcessOrDeferMessage(HWND hwnd,
     }
 
     // Messages that are safe to pass to DefWindowProc go here.
     case WM_GETICON:
     case WM_GETMINMAXINFO:
     case WM_GETTEXT:
     case WM_NCHITTEST:
     case WM_SETICON:
+    case WM_STYLECHANGING:
+    case WM_STYLECHANGED:
     case WM_SYNCPAINT: // Intentional fall-through.
     case WM_WINDOWPOSCHANGING: {
       return DefWindowProc(hwnd, uMsg, wParam, lParam);
     }
 
     // Unknown messages only.
     default: {
 #ifdef DEBUG
--- a/widget/src/windows/nsWindowGfx.cpp
+++ b/widget/src/windows/nsWindowGfx.cpp
@@ -325,28 +325,20 @@ EnsureSharedSurfaceSize(gfxIntSize size)
     sSharedSurfaceData = (PRUint8 *)malloc(WORDSSIZE(sSharedSurfaceSize) * 4);
   }
 
   return (sSharedSurfaceData != nsnull);
 }
 
 PRBool nsWindow::OnPaint(HDC aDC)
 {
-#ifdef MOZ_IPC
   if (mWindowType == eWindowType_plugin) {
-    PluginInstanceParent* instance = reinterpret_cast<PluginInstanceParent*>(
-      ::GetPropW(mWnd, L"PluginInstanceParentProperty"));
-    if (instance) {
-      if (!instance->CallUpdateWindow())
-        NS_ERROR("Failed to send message!");
-      ValidateRect(mWnd, NULL);
-      return PR_TRUE;
-    }
+    ValidateRect(mWnd, NULL);
+    return PR_TRUE;
   }
-#endif
 
   nsPaintEvent willPaintEvent(PR_TRUE, NS_WILL_PAINT, this);
   DispatchWindowEvent(&willPaintEvent);
 
 #ifdef CAIRO_HAS_DDRAW_SURFACE
   if (IsRenderMode(gfxWindowsPlatform::RENDER_IMAGE_DDRAW16)) {
     return OnPaintImageDDraw16();
   }