From cfc8100176661524acd3c973ae3c33e138eaf7f5 Mon Sep 17 00:00:00 2001 From: Stuart Morgan Date: Fri, 6 Nov 2009 11:17:45 +0100 Subject: [PATCH] Bug 425958 - Fill an opaque NSView with white when Gecko refuses to draw, because not drawing anything means that garbage reaches the screen. r=mstange --HG-- extra : rebase_source : c43ccac7359cd376a4f6a138f538d203dc281909 --- widget/src/cocoa/nsChildView.mm | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/widget/src/cocoa/nsChildView.mm b/widget/src/cocoa/nsChildView.mm index fbf553cbc21e..35bf8de5a2ea 100644 --- a/widget/src/cocoa/nsChildView.mm +++ b/widget/src/cocoa/nsChildView.mm @@ -2617,7 +2617,14 @@ static const PRInt32 sShadowInvalidationInterval = 100; paintEvent.region = rgn; nsAutoRetainCocoaObject kungFuDeathGrip(self); - mGeckoChild->DispatchWindowEvent(paintEvent); + PRBool painted = mGeckoChild->DispatchWindowEvent(paintEvent); + if (!painted && [self isOpaque]) { + // Gecko refused to draw, but we've claimed to be opaque, so we have to + // draw something--fill with white. + CGContextSetRGBFillColor(aContext, 1, 1, 1, 1); + CGContextFillRect(aContext, CGRectMake(aRect.origin.x, aRect.origin.y, + aRect.size.width, aRect.size.height)); + } if (!mGeckoChild) return;