Skip to content

Commit

Permalink
Fix bug. Don't treat share window purple "pill" indicator as a window
Browse files Browse the repository at this point in the history
  • Loading branch information
nikitabobko committed Feb 17, 2025
1 parent 0f4bca6 commit e38a999
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion Sources/AppBundle/tree/MacWindow.swift
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,8 @@ func isWindow(_ axWindow: AXUIElement, _ app: MacApp) -> Bool {
return false
}

lazy var title = axWindow.get(Ax.titleAttr) ?? ""

// Try to filter out incredibly weird popup like AXWindows without any buttons.
// E.g.
// - Sonoma (macOS 14) keyboard layout switch
Expand All @@ -232,7 +234,8 @@ func isWindow(_ axWindow: AXUIElement, _ app: MacApp) -> Bool {
app.getFocusedAxWindow()?.containingWindowId() != axWindow.containingWindowId() &&

subrole != kAXStandardWindowSubrole &&
(axWindow.get(Ax.titleAttr) ?? "").isEmpty
// Share window purple "pill" indicator has "Window" title https://github.com/nikitabobko/AeroSpace/issues/1101
(title.isEmpty || title == "Window") // Maybe it doesn't work in non-English locale
{
return false
}
Expand Down

0 comments on commit e38a999

Please sign in to comment.