From 3a76aa2079f9584bfa512796527c91f1185c7756 Mon Sep 17 00:00:00 2001 From: "bzbarsky%mit.edu" Date: Mon, 31 Jan 2005 22:41:19 +0000 Subject: [PATCH] Repost invalidate events that fire in the middle of a view update batch. Bug 280214 partial fix, r+sr=roc git-svn-id: svn://10.0.0.236/trunk@168586 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/view/src/nsViewManager.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/mozilla/view/src/nsViewManager.cpp b/mozilla/view/src/nsViewManager.cpp index 5d6f6cf261b..8a79f17a652 100644 --- a/mozilla/view/src/nsViewManager.cpp +++ b/mozilla/view/src/nsViewManager.cpp @@ -4199,8 +4199,17 @@ nsViewManager::ProcessInvalidateEvent() { NS_ASSERTION(IsRootVM(), "Incorrectly targeted invalidate event"); - FlushPendingInvalidates(); + // If we're in the middle of an update batch, just repost the event, + // to be processed when the batch ends. + PRBool processEvent = (mUpdateBatchCnt == 0); + if (processEvent) { + FlushPendingInvalidates(); + } mInvalidateEventQueue = nsnull; + if (!processEvent) { + // We didn't actually process this event... post a new one + PostInvalidateEvent(); + } } NS_IMETHODIMP