macos: add needsConfirmQuit helper to surface and split structs

This commit is contained in:
Mitchell Hashimoto
2023-10-28 21:43:32 -07:00
parent 981efb11db
commit cd18f3455b
2 changed files with 23 additions and 0 deletions

View File

@@ -252,6 +252,13 @@ extension Ghostty {
// then the view is moved to a new window.
var initialSize: NSSize? = nil
// Returns true if quit confirmation is required for this surface to
// exit safely.
var needsConfirmQuit: Bool {
guard let surface = self.surface else { return false }
return ghostty_surface_needs_confirm_quit(surface)
}
// Returns the inspector instance for this surface, or nil if the
// surface has been closed.
var inspector: ghostty_inspector_t? {