         resizeSubviews(withOldSize: sizeBeforeHidden)
         setFrameSize(hiddenSize)
 
-        // Finally resize the window, causing our height to increase.
-        changeWindowHeight(by: originalHeight - hiddenHeight)
-
-        if originalNextKeyView != nil {
-            // Restore the key loop to its old configuration.
-            lastChildKeyView?.nextKeyView = nextKeyView
-            nextKeyView = originalNextKeyView
-        }
-
-        needsDisplay = true
+        let completion = { [self] in
+            if originalNextKeyView != nil {
+                // Restore the key loop to its old configuration.
+                lastChildKeyView?.nextKeyView = nextKeyView
+                nextKeyView = originalNextKeyView
+            }
+
+            needsDisplay = true
+        }
+
+        if let window = window, window.styleMask.contains(.fullScreen) {
+            // We're in full screen, so we can't resize the window. Resize ourself and other content views instead.
+            NSAnimationContext.runAnimationGroup { animationContext in
+                animationContext.completionHandler = completion
+                animationContext.allowsImplicitAnimation = true
+                changeSelfHeightAndAdjustOtherContentViews(by: (originalHeight - hiddenHeight))
+            }
+        }
+        else {
+            // Finally resize the window, causing our height to increase.
+            changeWindowHeight(by: originalHeight - hiddenHeight)
+            completion()
+        }
     }
 
     private func removeSubviews() {

        }
    }

}

        // (The window width may change while the subviews are hidden.)
        sizeBeforeHidden = frame.size

        let completion = { [self] in
            // After the animation, remove our subviews from the view hierarchy.
            removeSubviews()
            needsDisplay = true
        }

        if let window = window, window.styleMask.contains(.fullScreen) {
            // We're in full screen, so we can't resize the window. Resize ourself and other content views instead.
            NSAnimationContext.runAnimationGroup { animationContext in
                animationContext.completionHandler = completion
                animationContext.allowsImplicitAnimation = true
                changeSelfHeightAndAdjustOtherContentViews(by: -(originalHeight - hiddenHeight))
            }
        }
        else {
            // Now shrink the window, causing this view to shrink and our subviews to be obscured.
            changeWindowHeight(by: -(originalHeight - hiddenHeight))
            completion()
        }
    }

    private func show() {
