Skip to content

Commit

Permalink
Make sure that special treatment for Firefox windows works for all Fi…
Browse files Browse the repository at this point in the history
…refox editions

_closes #1108
closes #1130

- Works for Firefox, Firefox Developer Edition, and Firefox Nightly
  version

Co-authored-by: fullmetalsheep <[email protected]>
  • Loading branch information
nikitabobko and fullmetalsheep committed Feb 23, 2025
1 parent ce6628e commit 732927b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions Sources/AppBundle/tree/AbstractApp.swift
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ class AbstractApp: Hashable {

extension AbstractApp {
func asMacApp() -> MacApp { self as! MacApp }

func isFirefox() -> Bool {
["org.mozilla.firefox", "org.mozilla.firefoxdeveloperedition", "org.mozilla.nightly"].contains(id ?? "")
}
}

extension Window {
Expand Down
4 changes: 2 additions & 2 deletions Sources/AppBundle/tree/MacWindow.swift
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ func isWindow(_ axWindow: AXUIElement, _ app: MacApp) -> Bool {
return false
}

if app.id == "org.mozilla.firefox" {
if app.isFirefox() {
return isWindowNew(axWindow, app)
}

Expand Down Expand Up @@ -310,7 +310,7 @@ func isDialogHeuristic(_ axWindow: AXUIElement, _ app: MacApp) -> Bool {
}
// Firefox: Picture in Picture window doesn't have minimize button.
// todo. bug: when firefox shows non-native fullscreen, minimize button disables for all other windows
if app.id == "org.mozilla.firefox" && axWindow.get(Ax.minimizeButtonAttr)?.get(Ax.enabledAttr) != true {
if app.isFirefox() && axWindow.get(Ax.minimizeButtonAttr)?.get(Ax.enabledAttr) != true {
return true
}
if app.id == "com.apple.PhotoBooth" { return true }
Expand Down

0 comments on commit 732927b

Please sign in to comment.