From 43eaccf7322d373389681963b2325387941c3466 Mon Sep 17 00:00:00 2001 From: Markus Stange Date: Thu, 27 Jan 2011 07:56:22 +0100 Subject: [PATCH] Backed out changeset 44c42d8b8d08 (bug 562138 part 1) because it caused bug 627824 and bug 628861. --- view/src/nsView.cpp | 24 +++++++++--------------- 1 file changed, 9 insertions(+), 15 deletions(-) diff --git a/view/src/nsView.cpp b/view/src/nsView.cpp index 5c832e1b1f5..8244bea54e9 100644 --- a/view/src/nsView.cpp +++ b/view/src/nsView.cpp @@ -438,8 +438,6 @@ void nsView::DoResetWidgetBounds(PRBool aMoveOnly, return; } - NS_PRECONDITION(mWindow, "Why was this called??"); - nsIntRect curBounds; mWindow->GetBounds(curBounds); @@ -455,19 +453,13 @@ void nsView::DoResetWidgetBounds(PRBool aMoveOnly, return; } + NS_PRECONDITION(mWindow, "Why was this called??"); + nsIntRect newBounds = CalcWidgetBounds(type); PRBool changedPos = curBounds.TopLeft() != newBounds.TopLeft(); PRBool changedSize = curBounds.Size() != newBounds.Size(); - PRBool curVisibility; - mWindow->IsVisible(curVisibility); - PRBool newVisibility = IsEffectivelyVisible(); - - if (curVisibility && !newVisibility) { - mWindow->Show(PR_FALSE); - } - // Child views are never attached to top level widgets, this is safe. if (changedPos) { if (changedSize && !aMoveOnly) { @@ -481,10 +473,6 @@ void nsView::DoResetWidgetBounds(PRBool aMoveOnly, mWindow->Resize(newBounds.width, newBounds.height, aInvalidateChangedSize); } // else do nothing! } - - if (!curVisibility && newVisibility) { - mWindow->Show(PR_TRUE); - } } void nsView::SetDimensions(const nsRect& aRect, PRBool aPaint, PRBool aResizeWidget) @@ -516,7 +504,13 @@ void nsView::NotifyEffectiveVisibilityChanged(PRBool aEffectivelyVisible) if (nsnull != mWindow) { - ResetWidgetBounds(PR_FALSE, PR_TRUE, PR_FALSE); + if (aEffectivelyVisible) + { + DoResetWidgetBounds(PR_FALSE, PR_TRUE); + mWindow->Show(PR_TRUE); + } + else + mWindow->Show(PR_FALSE); } for (nsView* child = mFirstChild; child; child = child->mNextSibling) {