Fix bug # 132493: Mac OS X sheets issue. r=pinkerton sr=ben a=asa

This commit is contained in:
rjc%netscape.com 2002-04-06 02:50:30 +00:00
parent 0037682093
commit 66cac563c2
2 changed files with 27 additions and 1 deletions

View File

@ -828,7 +828,16 @@ NS_IMETHODIMP nsMacWindow::Show(PRBool bState)
if ( mIsSheet && parentWindowRef ) {
WindowPtr top = GetWindowTop(parentWindowRef);
if (piParentWidget)
{
piParentWidget->SetIgnoreDeactivate(PR_TRUE);
PRBool sheetFlag = PR_FALSE;
if (parentWindowRef &&
NS_SUCCEEDED(piParentWidget->GetIsSheet(&sheetFlag)) && (sheetFlag))
{
::GetSheetWindowParent(parentWindowRef, &top);
::HideSheetWindow(parentWindowRef);
}
}
::ShowSheetWindow(mWindowPtr, top);
UpdateWindowMenubar(parentWindowRef, PR_FALSE);
gEventDispatchHandler.DispatchGuiEvent(this, NS_GOTFOCUS);
@ -872,7 +881,14 @@ NS_IMETHODIMP nsMacWindow::Show(PRBool bState)
// we need to ensure that the top app window is active
WindowPtr top = GetWindowTop(parentWindowRef);
if ( mAcceptsActivation ) {
PRBool sheetFlag = PR_FALSE;
if (parentWindowRef &&
NS_SUCCEEDED(piParentWidget->GetIsSheet(&sheetFlag)) && (sheetFlag))
{
::GetSheetWindowParent(parentWindowRef, &top);
::ShowSheetWindow(parentWindowRef, top);
}
else if ( mAcceptsActivation ) {
::ShowWindow(top);
}
else {
@ -1371,6 +1387,13 @@ nsMacWindow::SetIgnoreDeactivate(PRBool ignoreDeactivate)
return(NS_OK);
}
NS_IMETHODIMP
nsMacWindow::GetIsSheet(PRBool *_retval)
{
*_retval = mIsSheet;
return(NS_OK);
}
//-------------------------------------------------------------------------
//

View File

@ -46,5 +46,8 @@ interface nsPIWidgetMac : nsISupports
// True if window should ignore the next deactivate event it receives
attribute boolean ignoreDeactivate;
// True if window is a sheet
readonly attribute boolean isSheet;
}; // nsPIWidgetMac