mirror of
https://github.com/lwouis/alt-tab-macos.git
synced 2026-05-24 11:20:36 +00:00
fix: apps with no open window might not show up (closes #5424)
This commit is contained in:
@@ -146,7 +146,11 @@ class Application: NSObject {
|
||||
// apps don't always create kAXApplicationActivatedNotification upon launch; we update frontmostPid in case it has changed
|
||||
Applications.frontmostPid = NSWorkspace.shared.frontmostApplication?.processIdentifier
|
||||
// apps don't always send kAXWindowCreatedNotification upon launch; we manually check to prevent missing windows
|
||||
if let self { Applications.manuallyUpdateWindows(self) }
|
||||
guard let self else { return }
|
||||
if addWindowlessWindowIfNeeded() != nil {
|
||||
App.refreshOpenUiAfterExternalEvent([])
|
||||
}
|
||||
Applications.manuallyUpdateWindows(self)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -40,12 +40,6 @@ class Applications {
|
||||
guard let app, let axUiElement = app.axUiElement else { return }
|
||||
let axWindows = try axUiElement.allWindows(app.pid)
|
||||
guard !axWindows.isEmpty else {
|
||||
DispatchQueue.main.async { [weak app] in
|
||||
guard let app else { return }
|
||||
if app.addWindowlessWindowIfNeeded() != nil {
|
||||
App.refreshOpenUiAfterExternalEvent([])
|
||||
}
|
||||
}
|
||||
// workaround: some apps launch but take a while to create their window(s)
|
||||
// initial windows don't trigger a windowCreated notification, so we won't get notified
|
||||
// it's very unlikely an app would launch with no initial window
|
||||
|
||||
Reference in New Issue
Block a user