Merge backout.

This commit is contained in:
Markus Stange 2011-01-27 07:58:10 +01:00
commit 3c4d1e648c
2 changed files with 10 additions and 30 deletions

View File

@ -296,7 +296,6 @@ public:
static void UnifiedShading(void* aInfo, const CGFloat* aIn, CGFloat* aOut);
void SetPopupWindowLevel();
PRBool IsVisible();
PRBool IsChildInFailingLeftClickThrough(NSView *aChild);
PRBool ShouldFocusPlugin();
@ -340,7 +339,6 @@ protected:
// this is used for sibling sheet contention only
PRPackedBool mFullScreen;
PRPackedBool mModal;
PRPackedBool mIsShowing; // PR_TRUE during a Show(PR_TRUE) call.
PRInt32 mNumModalDescendents;
};

View File

@ -148,7 +148,6 @@ nsCocoaWindow::nsCocoaWindow()
, mSheetNeedsShow(PR_FALSE)
, mFullScreen(PR_FALSE)
, mModal(PR_FALSE)
, mIsShowing(PR_FALSE)
, mNumModalDescendents(0)
{
@ -533,20 +532,14 @@ void* nsCocoaWindow::GetNativeData(PRUint32 aDataType)
NS_OBJC_END_TRY_ABORT_BLOCK_NSNULL;
}
PRBool
nsCocoaWindow::IsVisible()
{
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_RETURN;
return [mWindow isVisible] || mSheetNeedsShow || mIsShowing;
NS_OBJC_END_TRY_ABORT_BLOCK_RETURN(PR_FALSE);
}
NS_IMETHODIMP nsCocoaWindow::IsVisible(PRBool & aState)
{
aState = IsVisible();
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT;
aState = ([mWindow isVisible] || mSheetNeedsShow);
return NS_OK;
NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT;
}
NS_IMETHODIMP nsCocoaWindow::SetModal(PRBool aState)
@ -631,7 +624,7 @@ NS_IMETHODIMP nsCocoaWindow::Show(PRBool bState)
// We need to re-execute sometimes in order to bring already-visible
// windows forward.
if (!bState && !IsVisible())
if (!mSheetNeedsShow && !bState && ![mWindow isVisible])
return NS_OK;
nsIWidget* parentWidget = mParent;
@ -640,23 +633,10 @@ NS_IMETHODIMP nsCocoaWindow::Show(PRBool bState)
(NSWindow*)parentWidget->GetNativeData(NS_NATIVE_WINDOW) : nil;
if (bState && !mBounds.IsEmpty()) {
// IsVisible can be entered from inside this method, for example through
// synchronous painting. Unfortunately, at that point [mWindow isVisible]
// still returns NO, so we use mIsShowing to tell us that we should return
// true from IsVisible anyway.
mIsShowing = PR_TRUE;
if (mPopupContentView) {
// Ensure our content view is visible. We never need to hide it.
mPopupContentView->Show(PR_TRUE);
}
if (mWindowType == eWindowType_sheet) {
// bail if no parent window (its basically what we do in Carbon)
if (!nativeParentWindow || !piParentWidget) {
mIsShowing = PR_FALSE;
if (!nativeParentWindow || !piParentWidget)
return NS_ERROR_FAILURE;
}
NSWindow* topNonSheetWindow = nativeParentWindow;
@ -749,7 +729,6 @@ NS_IMETHODIMP nsCocoaWindow::Show(PRBool bState)
NS_OBJC_END_TRY_LOGONLY_BLOCK;
SendSetZLevelEvent();
}
mIsShowing = PR_FALSE;
}
else {
// roll up any popups if a top-level window is going away
@ -855,6 +834,9 @@ NS_IMETHODIMP nsCocoaWindow::Show(PRBool bState)
}
}
}
if (mPopupContentView)
mPopupContentView->Show(bState);
return NS_OK;