Bug 630276 - Closing full-screen windows does not restore menubar/dock on Mac. r=joshaas,mstange a=blocking2.0
authorMehdi Mulani <mmmulani@uwaterloo.ca>
Wed, 09 Feb 2011 13:27:24 -0800
changeset 62309 9e27e7d046990bc40b502e5710aadeed7799cfed
parent 62308 83a0538956cc3fa842c7e786670a07417e875409
child 62310 346e58464d3ddbebcd309ba1cc0486f2dc3a3493
push idunknown
push userunknown
push dateunknown
reviewersjoshaas, mstange, blocking2
bugs630276
milestone2.0b12pre
Bug 630276 - Closing full-screen windows does not restore menubar/dock on Mac. r=joshaas,mstange a=blocking2.0
widget/src/cocoa/nsCocoaWindow.mm
--- a/widget/src/cocoa/nsCocoaWindow.mm
+++ b/widget/src/cocoa/nsCocoaWindow.mm
@@ -166,20 +166,16 @@ void nsCocoaWindow::DestroyNativeWindow(
 
   NS_OBJC_END_TRY_ABORT_BLOCK;
 }
 
 nsCocoaWindow::~nsCocoaWindow()
 {
   NS_OBJC_BEGIN_TRY_ABORT_BLOCK;
 
-  if (mFullScreen) {
-    nsCocoaUtils::HideOSChromeOnScreen(PR_FALSE, [mWindow screen]);
-  }
-
   // Notify the children that we're gone.  Popup windows (e.g. tooltips) can
   // have nsChildView children.  'kid' is an nsChildView object if and only if
   // its 'type' is 'eWindowType_child' or 'eWindowType_plugin'.
   // childView->ResetParent() can change our list of children while it's
   // being iterated, so the way we iterate the list must allow for this.
   for (nsIWidget* kid = mLastChild; kid;) {
     nsWindowType kidType;
     kid->GetWindowType(kidType);
@@ -484,16 +480,20 @@ NS_IMETHODIMP nsCocoaWindow::CreatePopup
 NS_IMETHODIMP nsCocoaWindow::Destroy()
 {
   if (mPopupContentView)
     mPopupContentView->Destroy();
 
   nsBaseWidget::Destroy();
   nsBaseWidget::OnDestroy();
 
+  if (mFullScreen) {
+    nsCocoaUtils::HideOSChromeOnScreen(PR_FALSE, [mWindow screen]);
+  }
+
   return NS_OK;
 }
 
 nsIWidget* nsCocoaWindow::GetSheetWindowParent(void)
 {
   if (mWindowType != eWindowType_sheet)
     return nsnull;
   nsCocoaWindow *parent = static_cast<nsCocoaWindow*>(mParent);