mirror of
https://github.com/lwouis/alt-tab-macos.git
synced 2026-05-24 11:20:36 +00:00
feat: support autocad non-native windows (#3219)
This commit is contained in:
@@ -106,7 +106,8 @@ extension AXUIElement {
|
||||
sanGuoShaAirWD(runningApp) ||
|
||||
dvdFab(runningApp) ||
|
||||
drBetotte(runningApp) ||
|
||||
androidEmulator(runningApp, title)
|
||||
androidEmulator(runningApp, title) ||
|
||||
autocad(runningApp, subrole)
|
||||
) && (
|
||||
mustHaveIfJetbrainApp(runningApp, title, subrole, size!) &&
|
||||
mustHaveIfSteam(runningApp, title, role) &&
|
||||
@@ -225,6 +226,11 @@ extension AXUIElement {
|
||||
return runningApp.localizedName == "scrcpy" && level == CGWindow.floatingWindow && role == kAXWindowRole && subrole == kAXStandardWindowSubrole
|
||||
}
|
||||
|
||||
private static func autocad(_ runningApp: NSRunningApplication, _ subrole: String?) -> Bool {
|
||||
// AutoCAD uses the undocumented "AXDocumentWindow" subrole
|
||||
return (runningApp.bundleIdentifier?.hasPrefix("com.autodesk.AutoCAD") ?? false) && subrole == kAXDocumentWindowSubrole
|
||||
}
|
||||
|
||||
func position() throws -> CGPoint? {
|
||||
return try value(kAXPositionAttribute, CGPoint.zero, .cgPoint)
|
||||
}
|
||||
|
||||
@@ -204,6 +204,9 @@ func SLSRequestScreenCaptureAccess() -> UInt8
|
||||
let kAXFullscreenAttribute = "AXFullScreen"
|
||||
let kAXStatusLabelAttribute = "AXStatusLabel"
|
||||
|
||||
// for some reason, these attributes are missing from AXRoleConstants
|
||||
let kAXDocumentWindowSubrole = "AXDocumentWindow"
|
||||
|
||||
enum CGSSymbolicHotKey: Int, CaseIterable {
|
||||
case commandTab = 1
|
||||
case commandShiftTab = 2
|
||||
|
||||
Reference in New Issue
Block a user