Bug 891424. Hide cocoa window's when they are destroyed, otherwise they can stay on screen, and remove a different fix for the same bug that caused a regression. r=smichaud
authorTimothy Nikkel <tnikkel@gmail.com>
Fri, 19 Jul 2013 15:57:59 -0500
changeset 151625 a8051c99d7c3e5cf70a78492aefb9ad2f5d1d65f
parent 151624 24eb84ceb5ed13a83c8979d97fd6d955316609e1
child 151626 bab7da9de71f2558d5e6f69ba7fef356b759444f
push id2859
push userakeybl@mozilla.com
push dateMon, 16 Sep 2013 19:14:59 +0000
treeherdermozilla-beta@87d3c51cd2bf [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssmichaud
bugs891424
milestone25.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 891424. Hide cocoa window's when they are destroyed, otherwise they can stay on screen, and remove a different fix for the same bug that caused a regression. r=smichaud We also remove a different fix for this same bug that caused some regressions: calling RemoveChild so that the nsCocoaWindow actually dies.
widget/cocoa/nsCocoaWindow.mm
--- a/widget/cocoa/nsCocoaWindow.mm
+++ b/widget/cocoa/nsCocoaWindow.mm
@@ -507,25 +507,26 @@ NS_IMETHODIMP nsCocoaWindow::CreatePopup
 
   return NS_OK;
 
   NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT;
 }
 
 NS_IMETHODIMP nsCocoaWindow::Destroy()
 {
+  // The reference from a possible sibling widget will never get cleared because
+  // we don't implement GetParent so RemoveChild never removes us from the
+  // sibling widget list. So if we don't hide ourselves here we may stay on
+  // screen. This is gross. (Bug 891424)
+  Show(false);
+
   if (mPopupContentView)
     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) {
     // On Lion we don't have to mess with the OS chrome when in Full Screen
     // mode.  But we do have to destroy the native window here (and not wait
     // for that to happen in our destructor).  We don't switch away from the
     // native window's space until the window is destroyed, and otherwise this
     // might not happen for several seconds (because at least one object