Bug 891424. Directly remove nsCocoaWindow's from their parent in Destroy(). This allows us to stop implementing GetParent because the mac widget code has some assumptions about that always returning null. r=smichaud

This reverts implementing GetParent on nsCocoaWindow's (ie back out bug 869151) because the mac widget code has some assumptions about that. Instead we just remove nsCocoaWindow's from their mParent in Destroy() which will still keep bug 869151 fixed.
This commit is contained in:
Timothy Nikkel 2013-07-09 15:14:01 -05:00
parent 8d74513780
commit f8937eca28
2 changed files with 5 additions and 7 deletions

View File

@ -222,8 +222,6 @@ public:
NS_IMETHOD Destroy();
virtual nsIWidget* GetParent(void);
NS_IMETHOD Show(bool aState);
virtual nsIWidget* GetSheetWindowParent(void);
NS_IMETHOD Enable(bool aState);

View File

@ -516,6 +516,11 @@ NS_IMETHODIMP nsCocoaWindow::Destroy()
mPopupContentView->Destroy();
nsBaseWidget::Destroy();
// nsBaseWidget::Destroy() calls GetParent()->RemoveChild(this). But we
// don't implement GetParent(), so we need to do the equivalent here.
if (mParent) {
mParent->RemoveChild(this);
}
nsBaseWidget::OnDestroy();
if (mFullScreen) {
@ -536,11 +541,6 @@ NS_IMETHODIMP nsCocoaWindow::Destroy()
return NS_OK;
}
nsIWidget* nsCocoaWindow::GetParent()
{
return mParent;
}
nsIWidget* nsCocoaWindow::GetSheetWindowParent(void)
{
if (mWindowType != eWindowType_sheet)