Bug 648935 - When paint events are deferred in WindowsMessageLoop, temporarily validate the plugin until painting can occur. r=bent.

This commit is contained in:
Jim Mathies
2011-05-18 06:57:08 -05:00
parent cfa00163de
commit 3301ac49db
2 changed files with 17 additions and 7 deletions

View File

@@ -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!");
}