Bug 851641. Don't make view visibility changes immediately to the underlying widget. Post a pending update to do it. r=roc,mats

This commit is contained in:
Markus Stange 2013-05-01 16:21:32 -05:00
Родитель 84d39eeee2
Коммит ca6f57edb1
1 изменённых файлов: 14 добавлений и 10 удалений

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

@ -234,7 +234,15 @@ void nsView::DoResetWidgetBounds(bool aMoveOnly,
if (mViewManager->GetRootView() == this) {
return;
}
NS_PRECONDITION(mWindow, "Why was this called??");
bool curVisibility = mWindow->IsVisible();
bool newVisibility = IsEffectivelyVisible();
if (curVisibility && !newVisibility) {
mWindow->Show(false);
}
nsIntRect curBounds;
mWindow->GetClientBounds(curBounds);
@ -252,8 +260,6 @@ void nsView::DoResetWidgetBounds(bool aMoveOnly,
return;
}
NS_PRECONDITION(mWindow, "Why was this called??");
nsIntRect newBounds = CalcWidgetBounds(type);
bool changedPos = curBounds.TopLeft() != newBounds.TopLeft();
@ -304,6 +310,10 @@ void nsView::DoResetWidgetBounds(bool aMoveOnly,
aInvalidateChangedSize);
} // else do nothing!
}
if (!curVisibility && newVisibility) {
mWindow->Show(true);
}
}
void nsView::SetDimensions(const nsRect& aRect, bool aPaint, bool aResizeWidget)
@ -337,13 +347,7 @@ void nsView::NotifyEffectiveVisibilityChanged(bool aEffectivelyVisible)
if (nullptr != mWindow)
{
if (aEffectivelyVisible)
{
DoResetWidgetBounds(false, true);
mWindow->Show(true);
}
else
mWindow->Show(false);
ResetWidgetBounds(false, false);
}
for (nsView* child = mFirstChild; child; child = child->mNextSibling) {