mirror of
https://github.com/lwouis/alt-tab-macos.git
synced 2026-05-24 11:20:36 +00:00
fix: don't show empty color-slurp windows
This commit is contained in:
committed by
Louis Pontoise
parent
fd2f14ae2e
commit
01b3a428d9
@@ -99,11 +99,11 @@ extension AXUIElement {
|
||||
sanGuoShaAirWD(runningApp) ||
|
||||
dvdFab(runningApp) ||
|
||||
drBetotte(runningApp) ||
|
||||
androidEmulator(runningApp, title) ||
|
||||
colorSlurp(runningApp)
|
||||
androidEmulator(runningApp, title)
|
||||
) &&
|
||||
mustHaveIfJetbrainApp(runningApp, title, subrole, size!) &&
|
||||
mustHaveIfSteam(runningApp, title, role)
|
||||
mustHaveIfSteam(runningApp, title, role) &&
|
||||
mustHaveIfColorSlurp(runningApp, title, subrole)
|
||||
))
|
||||
}
|
||||
|
||||
@@ -117,6 +117,10 @@ extension AXUIElement {
|
||||
)
|
||||
}
|
||||
|
||||
private static func mustHaveIfColorSlurp(_ runningApp: NSRunningApplication, _ title: String?, _ subrole: String?) -> Bool {
|
||||
return runningApp.bundleIdentifier != "com.IdeaPunch.ColorSlurp" || subrole == kAXStandardWindowSubrole
|
||||
}
|
||||
|
||||
private static func iina(_ runningApp: NSRunningApplication) -> Bool {
|
||||
// IINA.app can have videos float (level == 2 instead of 0)
|
||||
// there is also complex animations during which we may or may not consider the window not a window
|
||||
@@ -201,11 +205,6 @@ extension AXUIElement {
|
||||
return title != "" && Applications.isAndroidEmulator(runningApp)
|
||||
}
|
||||
|
||||
private static func colorSlurp(_ runningApp: NSRunningApplication) -> Bool {
|
||||
// ColorSlurp presents its dialog as a kAXSystemDialogSubrole, so we need a special check
|
||||
return runningApp.bundleIdentifier == "com.IdeaPunch.ColorSlurp"
|
||||
}
|
||||
|
||||
func position() throws -> CGPoint? {
|
||||
return try value(kAXPositionAttribute, CGPoint.zero, .cgPoint)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user