Skip to content

Commit

Permalink
feat: improve support for color-slurp windows
Browse files Browse the repository at this point in the history
  • Loading branch information
lwouis committed Jun 23, 2023
1 parent 7d823dd commit 8605b23
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/api-wrappers/AXUIElement.swift
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,8 @@ extension AXUIElement {
sanGuoShaAirWD(runningApp) ||
dvdFab(runningApp) ||
drBetotte(runningApp) ||
androidEmulator(runningApp, title)
androidEmulator(runningApp, title) ||
colorSlurp(runningApp)
) &&
mustHaveIfJetbrainApp(runningApp, title, subrole, size!) &&
mustHaveIfSteam(runningApp, title, role)
Expand Down Expand Up @@ -200,6 +201,11 @@ 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)
}
Expand Down

0 comments on commit 8605b23

Please sign in to comment.