mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-08-02 14:57:31 +03:00
macos: integrate needsConfirmQuit to quit if all windows are at prompt
This commit is contained in:
@ -102,6 +102,9 @@ class AppDelegate: NSObject, ObservableObject, NSApplicationDelegate, GhosttyApp
|
||||
}
|
||||
}
|
||||
|
||||
// If our app says we don't need to confirm, we can exit now.
|
||||
if (!ghostty.needsConfirmQuit) { return .terminateNow }
|
||||
|
||||
// We have some visible window, and all our windows will watch the confirmQuit.
|
||||
confirmQuit = true
|
||||
return .terminateLater
|
||||
|
@ -40,6 +40,12 @@ extension Ghostty {
|
||||
}
|
||||
}
|
||||
|
||||
/// True if we need to confirm before quitting.
|
||||
var needsConfirmQuit: Bool {
|
||||
guard let app = app else { return false }
|
||||
return ghostty_app_needs_confirm_quit(app)
|
||||
}
|
||||
|
||||
/// Cached clipboard string for `read_clipboard` callback.
|
||||
private var cached_clipboard_string: String? = nil
|
||||
|
||||
|
Reference in New Issue
Block a user