       self.window.setFrame(prevFrame, display: true, animate: false)
       self.titlebarThemed = false
     }
+
+    self.window.makeFirstResponder(firstResponder)
   }
 
   func set(repUrl url: URL?, themed: Bool) {


    let prevFrame = window.frame

    window.titlebarAppearsTransparent = false

    self.workspace.removeFromSuperview()


  }

  func unthemeTitlebar(dueFullScreen: Bool) {
    // NSWindow becomes the first responder at the end of this method.
    let firstResponder = self.window.firstResponder

    self.clearCustomTitle()

    guard let contentView = self.window.contentView else {
