macos: don't steal focus for config errors

This commit is contained in:
Mitchell Hashimoto
2023-09-11 13:59:03 -07:00
parent b7f4c1d707
commit ffd181f10d
2 changed files with 5 additions and 3 deletions

View File

@ -188,8 +188,11 @@ class AppDelegate: NSObject, ObservableObject, NSApplicationDelegate, GhosttyApp
// If we have configuration errors, we need to show them.
let c = ConfigurationErrorsController.sharedInstance
c.model.errors = state.configErrors()
Self.logger.warning("TEST did reload, count=\(c.model.errors.count)")
if (c.model.errors.count > 0) { c.showWindow(self) }
if (c.model.errors.count > 0) {
if (c.window == nil || !c.window!.isVisible) {
c.showWindow(self)
}
}
}
//MARK: - Dock Menu

View File

@ -32,7 +32,6 @@ class ConfigurationErrorsController: NSWindowController, NSWindowDelegate {
window.center()
window.level = .popUpMenu
window.contentView = NSHostingView(rootView: ConfigurationErrorsView(model: model))
window.makeKeyAndOrderFront(self)
}
//MARK: - NSWindowDelegate