Part of bug #5569. Make sure that areas that get an NS_PAINT event we always paint the default color when the view manager has refreshes disabled. This should fix the problem where before pages start loading in mail/news and the browser some areas aren't repainted. r=bryner sr=roc+moz.

This commit is contained in:
blizzard%redhat.com 2001-04-11 14:52:06 +00:00
Родитель e2dc3d6d88
Коммит 2e4c844de7
1 изменённых файлов: 20 добавлений и 1 удалений

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

@ -1907,7 +1907,26 @@ NS_IMETHODIMP nsViewManager::DispatchEvent(nsGUIEvent *aEvent, nsEventStatus *aS
//printf("refreshing: view: %x, %d, %d, %d, %d\n", view, damrect.x, damrect.y, damrect.width, damrect.height);
// Refresh the view
Refresh(view, ((nsPaintEvent*)aEvent)->renderingContext, &damrect, updateFlags);
if (mRefreshEnabled) {
Refresh(view, ((nsPaintEvent*)aEvent)->renderingContext, &damrect, updateFlags);
}
else {
// since we got an NS_PAINT event we need to draw something so we don't get blank areas.
nsCOMPtr<nsIWidget> widget;
GetWidgetForView(view, getter_AddRefs(widget));
if (widget) {
nsCOMPtr<nsIRenderingContext> context;
context = getter_AddRefs(CreateRenderingContext(*view));
if (context) {
nscolor bgColor = 0;
SystemAttrStruct info;
info.mColor = &bgColor;
mContext->GetSystemAttribute(eSystemAttr_Color_WindowBackground, &info);
context->SetColor(bgColor);
context->FillRect(damrect);
}
}
}
}
}