mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-10-06 01:46:33 +00:00
apprt/embedded: support new process alive callback on close
This commit is contained in:
@@ -60,7 +60,7 @@ extension Ghostty {
|
||||
read_clipboard_cb: { userdata in AppState.readClipboard(userdata) },
|
||||
write_clipboard_cb: { userdata, str in AppState.writeClipboard(userdata, string: str) },
|
||||
new_split_cb: { userdata, direction in AppState.newSplit(userdata, direction: direction) },
|
||||
close_surface_cb: { userdata in AppState.closeSurface(userdata) },
|
||||
close_surface_cb: { userdata, processAlive in AppState.closeSurface(userdata, processAlive: processAlive) },
|
||||
focus_split_cb: { userdata, direction in AppState.focusSplit(userdata, direction: direction) }
|
||||
)
|
||||
|
||||
@@ -132,7 +132,9 @@ extension Ghostty {
|
||||
])
|
||||
}
|
||||
|
||||
static func closeSurface(_ userdata: UnsafeMutableRawPointer?) {
|
||||
static func closeSurface(_ userdata: UnsafeMutableRawPointer?, processAlive: Bool) {
|
||||
// TODO: handle processAlive to show confirmation dialog. We probably want to attach
|
||||
// it to the notification and let downstream handle it.
|
||||
guard let surface = self.surfaceUserdata(from: userdata) else { return }
|
||||
NotificationCenter.default.post(name: Notification.ghosttyCloseSurface, object: surface)
|
||||
}
|
||||
|
Reference in New Issue
Block a user