fix: apps with no open window might not show up (closes #5424)
This commit is contained in:
1 parent
39b818de11
commit
8962ad1a54
2 files changed
+5
-7
No files matched your search
@@ -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