     
     fileprivate func applyAppearanceToWidgets() {
         let appearance = appearanceForWidgets()
-        titlebarWidgets?.forEach { $0.appearance = appearance }
+        titlebarWidgets.forEach { $0.appearance = appearance }
     }
     
     fileprivate var _storedTitlebarView: NSVisualEffectView?

        return NSAppearance(named: NSAppearanceNameVibrantDark)!
    }
    
    fileprivate var titlebarWidgets: [NSButton]? {
        return titlebarView?.subviews.flatMap { subview in
            guard subview.isKind(of: NSClassFromString("_NSThemeWidget")!) else { return nil }
            return subview as? NSButton
        }
    }
    
    fileprivate func appearanceForWidgets() -> NSAppearance? {
        if allowsPiPMode {

            }, completionHandler: nil)
    }
    
    open override func standardWindowButton(_ b: NSWindowButton) -> NSButton? {
        guard let button = super.standardWindowButton(b) else { return nil }
        
        titlebarWidgets.insert(button)
        
        return button
    }
    
    // MARK: - Content management
    
    open override var title: String {
