     }
   }
 
+  fileprivate func growWindow(by dy: CGFloat) {
+    guard let window = self.window else {
+      return
+    }
+
+    let frame = window.frame
+    window.setFrame(
+      CGRect(origin: frame.origin, size: CGSize(width: frame.width, height: frame.height + dy)),
+      display: true,
+      animate: false
+    )
+  }
+
   // ====== >8 ======
 
   fileprivate let root = ColorView(bg: .green)

  fileprivate var repIcon: NSButton?
  fileprivate var titleView: NSTextField?

  fileprivate func themeTitlebar() {
    guard let window = self.window else {
      return
    }

    self.titlebarThemed = true
  }

  fileprivate func unthemeTitlebar(dueFullScreen: Bool) {
    self.clearCustomTitle()

    guard let window = self.window, let contentView = window.contentView else {
      return
    }

    let prevFrame = window.frame

    window.titlebarAppearsTransparent = false

    self.root.removeFromSuperview()

    window.titleVisibility = .visible
    window.styleMask.remove(.fullSizeContentView)

    self.set(repUrl: window.representedURL, themed: false, grow: false)

    contentView.addSubview(self.root)
    self.root.autoPinEdgesToSuperviewEdges()

    if !dueFullScreen {
      if self.titlebarThemed {
        self.growWindow(by: -22)
        let dy = prevFrame.origin.y - window.frame.origin.y
        if dy != 0 {
          window.setFrame(window.frame.offsetBy(dx: 0, dy: dy), display: true, animate: false)
        }
      }

      self.titlebarThemed = false
    }
  }


  fileprivate func clearCustomTitle() {
    self.titleView?.removeFromSuperview()
    self.repIcon?.removeFromSuperview()

    self.titleView = nil
    self.repIcon = nil
  }

  fileprivate func internalSetRepUrl(_ url: URL?) {
