Bug 1294553 - Don't pretend that nsCocoaWindow is an interface in nsPIWidgetCocoa.idl, r=mstange

MozReview-Commit-ID: 4a6UTI4TxV9
This commit is contained in:
Michael Layzell 2016-08-11 17:51:11 -04:00
Родитель 7cff244225
Коммит 05d228443c
2 изменённых файлов: 10 добавлений и 9 удалений

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

@ -770,8 +770,9 @@ NS_IMETHODIMP nsCocoaWindow::Show(bool bState)
[NSApp endSheet:nativeParentWindow];
}
nsCocoaWindow* sheetShown = nullptr;
if (NS_SUCCEEDED(piParentWidget->GetChildSheet(true, &sheetShown)) &&
nsCOMPtr<nsIWidget> sheetShown;
if (NS_SUCCEEDED(piParentWidget->GetChildSheet(
true, getter_AddRefs(sheetShown))) &&
(!sheetShown || sheetShown == this)) {
// If this sheet is already the sheet actually being shown, don't
// tell it to show again. Otherwise the number of calls to
@ -888,11 +889,12 @@ NS_IMETHODIMP nsCocoaWindow::Show(bool bState)
[TopLevelWindowData deactivateInWindow:mWindow];
nsCocoaWindow* siblingSheetToShow = nullptr;
nsCOMPtr<nsIWidget> siblingSheetToShow;
bool parentIsSheet = false;
if (nativeParentWindow && piParentWidget &&
NS_SUCCEEDED(piParentWidget->GetChildSheet(false, &siblingSheetToShow)) &&
NS_SUCCEEDED(piParentWidget->GetChildSheet(
false, getter_AddRefs(siblingSheetToShow))) &&
siblingSheetToShow) {
// First, give sibling sheets an opportunity to show.
siblingSheetToShow->Show(true);
@ -1842,7 +1844,7 @@ NS_IMETHODIMP nsCocoaWindow::SendSetZLevelEvent()
return NS_OK;
}
NS_IMETHODIMP nsCocoaWindow::GetChildSheet(bool aShown, nsCocoaWindow** _retval)
NS_IMETHODIMP nsCocoaWindow::GetChildSheet(bool aShown, nsIWidget** _retval)
{
nsIWidget* child = GetFirstChild();
@ -1853,7 +1855,8 @@ NS_IMETHODIMP nsCocoaWindow::GetChildSheet(bool aShown, nsCocoaWindow** _retval)
if (cocoaWindow->mWindow &&
((aShown && [cocoaWindow->mWindow isVisible]) ||
(!aShown && cocoaWindow->mSheetNeedsShow))) {
*_retval = cocoaWindow;
nsCOMPtr<nsIWidget> widget = cocoaWindow;
widget.forget(_retval);
return NS_OK;
}
}

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

@ -5,8 +5,6 @@
#include "nsISupports.idl"
interface nsMenuBarX;
interface nsCocoaWindow;
interface nsIWidget;
[ptr] native NSWindowPtr(NSWindow);
@ -24,7 +22,7 @@ interface nsPIWidgetCocoa : nsISupports
// Find the displayed child sheet (if aShown) or a child sheet that
// wants to be displayed (if !aShown)
nsCocoaWindow GetChildSheet(in boolean aShown);
nsIWidget GetChildSheet(in boolean aShown);
// Get the parent widget (if any) StandardCreate() was called with.
nsIWidget GetRealParent();