     }
 
     self.window.setFrame(prevFrame, display: true, animate: false)
+    self.window.makeFirstResponder(prevFirstResponder)
   }
 }
 

      return
    }

    let prevFrame = self.window.frame

    self.clearCustomTitle()

    title.isEditable = false
    title.isSelectable = false
    title.isBordered = false
    title.isBezeled = false
    title.backgroundColor = .clear
    title.textColor = self.theme.foreground
    title.stringValue = self.window.title
