Skip to content

Commit

Permalink
fix: ghost windows in android studio (#closes 1224)
Browse files Browse the repository at this point in the history
  • Loading branch information
lwouis committed Nov 13, 2021
1 parent 3ad8619 commit b668928
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/api-wrappers/AXUIElement.swift
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ extension AXUIElement {
private static func jetbrainApp(_ runningApp: NSRunningApplication, _ title: String?, _ subrole: String?) -> Bool {
// jetbrain apps sometimes generate non-windows that pass all checks in isActualWindow
// they have no title, so we can filter them out based on that
return runningApp.bundleIdentifier?.range(of: "^com\\.(jetbrains\\.|google\\.android\\.studio).+?$", options: .regularExpression) == nil ||
return runningApp.bundleIdentifier?.range(of: "^com\\.(jetbrains\\.|google\\.android\\.studio).*?$", options: .regularExpression) == nil ||
(subrole == kAXStandardWindowSubrole || title != nil && title != "")
}

Expand Down
2 changes: 1 addition & 1 deletion src/logic/Application.swift
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class Application: NSObject {
if app.bundleIdentifier == "edu.stanford.protege" ||
app.bundleIdentifier?.range(of: "^com\\.install4j\\..+?$", options: .regularExpression) != nil ||
app.bundleIdentifier?.range(of: "^com\\.live2d\\.cubism\\..+?$", options: .regularExpression) != nil ||
app.bundleIdentifier?.range(of: "^com\\.(jetbrains\\.|google\\.android\\.studio).+?$", options: .regularExpression) != nil {
app.bundleIdentifier?.range(of: "^com\\.(jetbrains\\.|google\\.android\\.studio).*?$", options: .regularExpression) != nil {
return n.filter { $0 != kAXFocusedUIElementChangedNotification }
}
return n
Expand Down

0 comments on commit b668928

Please sign in to comment.