Bug 288222. resync widgets with views before trying to paint. r+sr=bzbarsky

This commit is contained in:
roc+%cs.cmu.edu 2005-03-30 20:25:15 +00:00
parent a29a02d2ec
commit 5281e0b914
2 changed files with 9 additions and 5 deletions

View File

@ -1601,7 +1601,7 @@ nsViewManager::CreateBlendingBuffers(nsIRenderingContext *aRC,
return buffers;
}
void nsViewManager::ProcessPendingUpdates(nsView* aView)
void nsViewManager::ProcessPendingUpdates(nsView* aView, PRBool aDoPaint)
{
NS_ASSERTION(IsRootVM(), "Updates will be missed");
@ -1617,10 +1617,10 @@ void nsViewManager::ProcessPendingUpdates(nsView* aView)
// process pending updates in child view.
for (nsView* childView = aView->GetFirstChild(); childView;
childView = childView->GetNextSibling()) {
ProcessPendingUpdates(childView);
ProcessPendingUpdates(childView, aDoPaint);
}
if (aView->HasNonEmptyDirtyRegion()) {
if (aDoPaint && aView->HasNonEmptyDirtyRegion()) {
// Push out updates after we've processed the children; ensures that
// damage is applied based on the final widget geometry
NS_ASSERTION(mRefreshEnabled, "Cannot process pending updates with refresh disabled");
@ -2022,6 +2022,10 @@ NS_IMETHODIMP nsViewManager::DispatchEvent(nsGUIEvent *aEvent, nsEventStatus *aS
EndUpdateViewBatch(NS_VMREFRESH_DEFERRED);
}
}
nsViewManager* rootVM = RootViewManager();
if (rootVM->mHasPendingUpdates) {
rootVM->ProcessPendingUpdates(mRootView, PR_FALSE);
}
Refresh(view, event->renderingContext, region,
NS_VMREFRESH_DOUBLE_BUFFER);
}
@ -4322,7 +4326,7 @@ nsViewManager::FlushPendingInvalidates()
}
if (mHasPendingUpdates) {
ProcessPendingUpdates(mRootView);
ProcessPendingUpdates(mRootView, PR_TRUE);
mHasPendingUpdates = PR_FALSE;
}
}

View File

@ -274,7 +274,7 @@ protected:
private:
void FlushPendingInvalidates();
void ProcessPendingUpdates(nsView *aView);
void ProcessPendingUpdates(nsView *aView, PRBool aDoPaint);
void ReparentChildWidgets(nsIView* aView, nsIWidget *aNewWidget);
void ReparentWidgets(nsIView* aView, nsIView *aParent);
already_AddRefed<nsIRenderingContext> CreateRenderingContext(nsView &aView);