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
Родитель 7d59d4601d
Коммит f81f1189fb
2 изменённых файлов: 17 добавлений и 7 удалений

Просмотреть файл

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

Просмотреть файл

@ -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