fixing cocoa widget painting too often bug 34708. r=mento sr=vlad

This commit is contained in:
pavlov%pavlov.net 2006-09-13 21:45:47 +00:00
parent 5e109dd899
commit 08f0ea13d6

View File

@ -1197,16 +1197,10 @@ NS_IMETHODIMP nsChildView::Invalidate(PRBool aIsSynchronous)
if (!mView || !mVisible)
return NS_OK;
[mView setNeedsDisplay:YES];
if (aIsSynchronous) {
[mView display];
}
else if ([NSView focusView]) {
// if a view is focussed (i.e. being drawn), then postpone the invalidate so that we
// don't lose it.
[mView performSelector:@selector(setNeedsDisplayWithValue:) withObject:nil afterDelay:0];
}
else {
[mView setNeedsDisplay:YES];
[mView displayIfNeeded];
}
return NS_OK;
@ -1225,16 +1219,10 @@ NS_IMETHODIMP nsChildView::Invalidate(const nsRect &aRect, PRBool aIsSynchronous
NSRect r;
GeckoRectToNSRect(aRect, r);
[mView setNeedsDisplayInRect:r];
if (aIsSynchronous) {
[mView displayRect:r];
}
else if ([NSView focusView]) {
// if a view is focussed (i.e. being drawn), then postpone the invalidate so that we
// don't lose it.
[mView performSelector:@selector(setNeedsDisplayWithValue:) withObject:[NSValue valueWithRect:r] afterDelay:0];
}
else {
[mView setNeedsDisplayInRect:r];
[mView displayIfNeeded];
}
return NS_OK;