fix: adobe audition windows were not showing up (closes #581)
This commit is contained in:
1 parent
29eff03e70
commit
6edced005a
3 files changed
+13
-7
No files matched your search
@@ -56,7 +56,8 @@ extension AXUIElement {
|
|||||||
books(runningApp) || (
|
books(runningApp) || (
|
||||||
// CGWindowLevel == .normalWindow helps filter out iStats Pro and other top-level pop-overs, and floating windows
|
// CGWindowLevel == .normalWindow helps filter out iStats Pro and other top-level pop-overs, and floating windows
|
||||||
isOnNormalLevel &&
|
isOnNormalLevel &&
|
||||||
(["AXStandardWindow", "AXDialog"].contains(subrole) ||
|
([kAXStandardWindowSubrole, kAXDialogSubrole].contains(subrole) ||
|
||||||
|
adobeAudition(runningApp, subrole) ||
|
||||||
steam(runningApp, title, role) ||
|
steam(runningApp, title, role) ||
|
||||||
worldOfWarcraft(runningApp, role) ||
|
worldOfWarcraft(runningApp, role) ||
|
||||||
battleNetBootstrapper(runningApp, role) ||
|
battleNetBootstrapper(runningApp, role) ||
|
||||||
@@ -67,6 +68,11 @@ extension AXUIElement {
|
|||||||
drBetotte(runningApp)))
|
drBetotte(runningApp)))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private func adobeAudition(_ runningApp: NSRunningApplication, _ subrole: String?) -> Bool {
|
||||||
|
// Books.app has animations on window creation. This means windows are originally created with subrole == AXUnknown or isOnNormalLevel == false
|
||||||
|
return runningApp.bundleIdentifier == "com.adobe.Audition" && subrole == kAXFloatingWindowSubrole
|
||||||
|
}
|
||||||
|
|
||||||
private func books(_ runningApp: NSRunningApplication) -> Bool {
|
private func books(_ runningApp: NSRunningApplication) -> Bool {
|
||||||
// Books.app has animations on window creation. This means windows are originally created with subrole == AXUnknown or isOnNormalLevel == false
|
// Books.app has animations on window creation. This means windows are originally created with subrole == AXUnknown or isOnNormalLevel == false
|
||||||
return runningApp.bundleIdentifier == "com.apple.iBooksX"
|
return runningApp.bundleIdentifier == "com.apple.iBooksX"
|
||||||
@@ -74,12 +80,12 @@ extension AXUIElement {
|
|||||||
|
|
||||||
private func worldOfWarcraft(_ runningApp: NSRunningApplication, _ role: String?) -> Bool {
|
private func worldOfWarcraft(_ runningApp: NSRunningApplication, _ role: String?) -> Bool {
|
||||||
// Battlenet bootstrapper windows have subrole == AXUnknown
|
// Battlenet bootstrapper windows have subrole == AXUnknown
|
||||||
return runningApp.bundleIdentifier == "com.blizzard.worldofwarcraft" && role == "AXWindow"
|
return runningApp.bundleIdentifier == "com.blizzard.worldofwarcraft" && role == kAXWindowRole
|
||||||
}
|
}
|
||||||
|
|
||||||
private func battleNetBootstrapper(_ runningApp: NSRunningApplication, _ role: String?) -> Bool {
|
private func battleNetBootstrapper(_ runningApp: NSRunningApplication, _ role: String?) -> Bool {
|
||||||
// Battlenet bootstrapper windows have subrole == AXUnknown
|
// Battlenet bootstrapper windows have subrole == AXUnknown
|
||||||
return runningApp.bundleIdentifier == "net.battle.bootstrapper" && role == "AXWindow"
|
return runningApp.bundleIdentifier == "net.battle.bootstrapper" && role == kAXWindowRole
|
||||||
}
|
}
|
||||||
|
|
||||||
private func drBetotte(_ runningApp: NSRunningApplication) -> Bool {
|
private func drBetotte(_ runningApp: NSRunningApplication) -> Bool {
|
||||||
@@ -102,7 +108,7 @@ extension AXUIElement {
|
|||||||
|
|
||||||
private func firefoxFullscreenVideo(_ runningApp: NSRunningApplication, _ role: String?) -> Bool {
|
private func firefoxFullscreenVideo(_ runningApp: NSRunningApplication, _ role: String?) -> Bool {
|
||||||
// Firefox fullscreen video have subrole == AXUnknown if fullscreen'ed when the base window is not fullscreen
|
// Firefox fullscreen video have subrole == AXUnknown if fullscreen'ed when the base window is not fullscreen
|
||||||
return (runningApp.bundleIdentifier?.hasPrefix("org.mozilla.firefox") ?? false) && role == "AXWindow"
|
return (runningApp.bundleIdentifier?.hasPrefix("org.mozilla.firefox") ?? false) && role == kAXWindowRole
|
||||||
}
|
}
|
||||||
|
|
||||||
private func androidEmulator(_ runningApp: NSRunningApplication, _ title: String?) -> Bool {
|
private func androidEmulator(_ runningApp: NSRunningApplication, _ title: String?) -> Bool {
|
||||||
|
|||||||
@@ -69,8 +69,8 @@ class Applications {
|
|||||||
if !App.app.appIsBeingUsed || Preferences.hideAppBadges { return }
|
if !App.app.appIsBeingUsed || Preferences.hideAppBadges { return }
|
||||||
retryAxCallUntilTimeout {
|
retryAxCallUntilTimeout {
|
||||||
if let dockPid = (list.first { $0.runningApplication.bundleIdentifier == "com.apple.dock" }?.pid),
|
if let dockPid = (list.first { $0.runningApplication.bundleIdentifier == "com.apple.dock" }?.pid),
|
||||||
let axList = (try AXUIElementCreateApplication(dockPid).children()?.first { try $0.role() == "AXList" }),
|
let axList = (try AXUIElementCreateApplication(dockPid).children()?.first { try $0.role() == kAXListRole }),
|
||||||
let axAppDockItem = (try axList.children()?.filter { try $0.subrole() == "AXApplicationDockItem" && ($0.appIsRunning() ?? false) }) {
|
let axAppDockItem = (try axList.children()?.filter { try $0.subrole() == kAXApplicationDockItemSubrole && ($0.appIsRunning() ?? false) }) {
|
||||||
let axAppDockItemUrlAndLabel = try axAppDockItem.map { try ($0.attribute(kAXURLAttribute, URL.self), $0.attribute(kAXStatusLabelAttribute, String.self)) }
|
let axAppDockItemUrlAndLabel = try axAppDockItem.map { try ($0.attribute(kAXURLAttribute, URL.self), $0.attribute(kAXStatusLabelAttribute, String.self)) }
|
||||||
DispatchQueue.main.async {
|
DispatchQueue.main.async {
|
||||||
refreshBadges_(axAppDockItemUrlAndLabel)
|
refreshBadges_(axAppDockItemUrlAndLabel)
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ func handleEvent(_ type: String, _ element: AXUIElement) throws {
|
|||||||
debugPrint("Accessibility event", type, type != kAXFocusedUIElementChangedNotification ? (try element.title() ?? "nil") : "nil")
|
debugPrint("Accessibility event", type, type != kAXFocusedUIElementChangedNotification ? (try element.title() ?? "nil") : "nil")
|
||||||
// events are handled concurrently, thus we check that the app is still running
|
// events are handled concurrently, thus we check that the app is still running
|
||||||
if let pid = try element.pid(),
|
if let pid = try element.pid(),
|
||||||
try (!(type == kAXWindowCreatedNotification && pid == ProcessInfo.processInfo.processIdentifier && element.subrole() == "AXUnknown")) {
|
try (!(type == kAXWindowCreatedNotification && pid == ProcessInfo.processInfo.processIdentifier && element.subrole() == kAXUnknownSubrole)) {
|
||||||
switch type {
|
switch type {
|
||||||
case kAXApplicationActivatedNotification: try applicationActivated(element)
|
case kAXApplicationActivatedNotification: try applicationActivated(element)
|
||||||
case kAXApplicationHiddenNotification,
|
case kAXApplicationHiddenNotification,
|
||||||
|
|||||||
Reference in new issue
Block a user