Skip to content

Commit

Permalink
fix: don't show firefox tooltips as windows (closes #2110)
Browse files Browse the repository at this point in the history
  • Loading branch information
lwouis committed Nov 13, 2022
1 parent f6fcac5 commit bf905b1
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/api-wrappers/AXUIElement.swift
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ extension AXUIElement {
steam(runningApp, title, role) ||
worldOfWarcraft(runningApp, role) ||
battleNetBootstrapper(runningApp, role) ||
firefoxFullscreenVideo(runningApp, role) ||
firefox(runningApp, role, size) ||
vlcFullscreenVideo(runningApp, role) ||
sanGuoShaAirWD(runningApp) ||
dvdFab(runningApp) ||
Expand Down Expand Up @@ -179,9 +179,10 @@ extension AXUIElement {
return runningApp.bundleIdentifier != "com.valvesoftware.steam" || (title != nil && title != "" && role != nil)
}

private static func firefoxFullscreenVideo(_ runningApp: NSRunningApplication, _ role: String?) -> Bool {
private static func firefox(_ runningApp: NSRunningApplication, _ role: String?, _ size: CGSize?) -> Bool {
// 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 == kAXWindowRole
// Firefox tooltips are implemented as windows with subrole == AXUnknown
return (runningApp.bundleIdentifier?.hasPrefix("org.mozilla.firefox") ?? false) && role == kAXWindowRole && size?.height != nil && size!.height > 400
}

private static func vlcFullscreenVideo(_ runningApp: NSRunningApplication, _ role: String?) -> Bool {
Expand Down

0 comments on commit bf905b1

Please sign in to comment.