Skip to content

Commit

Permalink
fix: chrome shortcuts apps don't show up (closes #185)
Browse files Browse the repository at this point in the history
  • Loading branch information
lwouis committed Mar 25, 2020
1 parent 6e190bf commit 0b35ebf
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/api-wrappers/AXUIElement.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,12 @@ extension AXUIElement {

func isActualWindow(_ runningApplication: NSRunningApplication) -> Bool {
// TODO: TotalFinder and XtraFinder double-window hacks (see #84)
// Some non-windows have subrole: nil (e.g. some OS elements), "AXUnknown" (e.g. Bartender), "AXSystemDialog" (e.g. Intellij tooltips)
// Some non-windows have title: nil (e.g. some OS elements)
// Some non-windows have subrole: nil (e.g. some OS elements), "AXUnknown" (e.g. Bartender), "AXSystemDialog" (e.g. Intellij tooltips)
// Minimized windows or windows of a hidden app have subrole "AXDialog"
// Activity Monitor main window subrole is "AXDialog" for a brief moment at launch; it then becomes "AXStandardWindow"
return title() != nil &&
(["AXStandardWindow", "AXDialog"].contains(subrole()) || isMinimized() || runningApplication.isHidden) &&
isOnNormalLevel()
// CGWindowLevel == .normalWindow helps filter out iStats Pro and other top-level pop-overs
return ["AXStandardWindow", "AXDialog"].contains(subrole()) && isOnNormalLevel()
}

func isOnNormalLevel() -> Bool {
Expand Down

0 comments on commit 0b35ebf

Please sign in to comment.