From f81f1189fb5cba3145802311a0fd9a7fed657ce7 Mon Sep 17 00:00:00 2001 From: Jim Mathies Date: Wed, 18 May 2011 06:57:08 -0500 Subject: [PATCH] Bug 648935 - When paint events are deferred in WindowsMessageLoop, temporarily validate the plugin until painting can occur. r=bent. --- ipc/glue/WindowsMessageLoop.cpp | 17 ++++++++++++++--- ipc/glue/WindowsMessageLoop.h | 7 +++---- 2 files changed, 17 insertions(+), 7 deletions(-) diff --git a/ipc/glue/WindowsMessageLoop.cpp b/ipc/glue/WindowsMessageLoop.cpp index 5b5c70faf30d..175c8fec8771 100644 --- a/ipc/glue/WindowsMessageLoop.cpp +++ b/ipc/glue/WindowsMessageLoop.cpp @@ -996,19 +996,30 @@ DeferredRedrawMessage::Run() NS_ASSERTION(ret, "RedrawWindow failed!"); } +DeferredUpdateMessage::DeferredUpdateMessage(HWND aHWnd) +{ + mWnd = aHWnd; + if (!GetUpdateRect(mWnd, &mUpdateRect, FALSE)) { + memset(&mUpdateRect, 0, sizeof(RECT)); + return; + } + ValidateRect(mWnd, &mUpdateRect); +} + void DeferredUpdateMessage::Run() { - AssertWindowIsNotNeutered(hWnd); - if (!IsWindow(hWnd)) { + AssertWindowIsNotNeutered(mWnd); + if (!IsWindow(mWnd)) { NS_ERROR("Invalid window!"); return; } + InvalidateRect(mWnd, &mUpdateRect, FALSE); #ifdef DEBUG BOOL ret = #endif - UpdateWindow(hWnd); + UpdateWindow(mWnd); NS_ASSERTION(ret, "UpdateWindow failed!"); } diff --git a/ipc/glue/WindowsMessageLoop.h b/ipc/glue/WindowsMessageLoop.h index 5746f58e51cd..82ec04db5fec 100644 --- a/ipc/glue/WindowsMessageLoop.h +++ b/ipc/glue/WindowsMessageLoop.h @@ -113,14 +113,13 @@ private: class DeferredUpdateMessage : public DeferredMessage { public: - DeferredUpdateMessage(HWND aHWnd) - : hWnd(aHWnd) - { } + DeferredUpdateMessage(HWND aHWnd); virtual void Run(); private: - HWND hWnd; + HWND mWnd; + RECT mUpdateRect; }; // This class duplicates a string that may exist in the lParam member of the