fix: show windows of apps without a bundle (e.g. not .app)

This commit is contained in:
Louis Pontoise authored and lwouis committed 2020-06-16 13:30:10 +09:00
1 parent b9d5784716
commit fd0623a706
1 file changed
+8 -2
+8 -2
View File
@@ -65,7 +65,13 @@ class Applications {
}
private static func isActualApplication(_ app: NSRunningApplication) -> Bool {
let bundlePackageType = app.bundleURL.flatMap { Bundle(url: $0) }.flatMap { $0.infoDictionary }.flatMap { $0["CFBundlePackageType"] as? String }
return bundlePackageType != "XPC!"
return app.activationPolicy != .prohibited || isNotXpc(app)
}
private static func isNotXpc(_ app: NSRunningApplication) -> Bool {
return app.bundleURL
.flatMap { Bundle(url: $0) }
.flatMap { $0.infoDictionary }
.flatMap { $0["CFBundlePackageType"] as? String } != "XPC!"
}
}