Fallback panel lookup for notify UI setup
This commit is contained in:
parent
acd8dbff69
commit
2023d8eb57
1 changed files with 24 additions and 1 deletions
|
|
@ -5691,8 +5691,31 @@ final class AppDelegate: NSObject, NSApplicationDelegate, UNUserNotificationCent
|
|||
) {
|
||||
let deadline = Date().addingTimeInterval(timeout)
|
||||
|
||||
func poll() {
|
||||
func resolvedSurfaceId() -> UUID? {
|
||||
if let surfaceId = tabManager.focusedPanelId(for: tabId) {
|
||||
return surfaceId
|
||||
}
|
||||
|
||||
guard let workspace = tabManager.tabs.first(where: { $0.id == tabId }) else {
|
||||
return nil
|
||||
}
|
||||
|
||||
if let terminalPanelId = workspace.focusedTerminalPanel?.id {
|
||||
return terminalPanelId
|
||||
}
|
||||
|
||||
if let terminalPanelId = workspace.terminalPanelForConfigInheritance()?.id {
|
||||
return terminalPanelId
|
||||
}
|
||||
|
||||
return workspace.panels.values
|
||||
.compactMap { ($0 as? TerminalPanel)?.id }
|
||||
.sorted(by: { $0.uuidString < $1.uuidString })
|
||||
.first
|
||||
}
|
||||
|
||||
func poll() {
|
||||
if let surfaceId = resolvedSurfaceId() {
|
||||
completion(surfaceId)
|
||||
return
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue