1
1
mirror of https://github.com/qvacua/vimr.git synced 2024-12-25 23:02:35 +03:00

GH-485 Restore previous first responder

This commit is contained in:
Tae Won Ha 2017-09-03 22:21:01 +02:00
parent 25a4c8dc91
commit 3f8a58e332
No known key found for this signature in database
GPG Key ID: E40743465B5B8B44

View File

@ -425,6 +425,8 @@ extension MainWindow {
return
}
let prevFirstResponder = self.window.firstResponder
self.window.titlebarAppearsTransparent = true
self.workspace.removeFromSuperview()
@ -438,6 +440,8 @@ extension MainWindow {
self.workspace.autoPinEdge(toSuperviewEdge: .left)
self.titlebarThemed = true
self.window.makeFirstResponder(prevFirstResponder)
}
fileprivate func unthemeTitlebar(dueFullScreen: Bool) {
@ -487,6 +491,7 @@ extension MainWindow {
return
}
let prevFirstResponder = self.window.firstResponder
let prevFrame = self.window.frame
self.clearCustomTitle()
@ -505,6 +510,7 @@ extension MainWindow {
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
@ -546,6 +552,7 @@ extension MainWindow {
}
self.window.setFrame(prevFrame, display: true, animate: false)
self.window.makeFirstResponder(prevFirstResponder)
}
}