feat: support autocad non-native windows (#3219)
This commit is contained in:
1 parent
7df1432744
commit
bbaef6cf8e
2 files changed
+10
-1
No files matched your search
@@ -106,7 +106,8 @@ extension AXUIElement {
|
|||||||
sanGuoShaAirWD(runningApp) ||
|
sanGuoShaAirWD(runningApp) ||
|
||||||
dvdFab(runningApp) ||
|
dvdFab(runningApp) ||
|
||||||
drBetotte(runningApp) ||
|
drBetotte(runningApp) ||
|
||||||
androidEmulator(runningApp, title)
|
androidEmulator(runningApp, title) ||
|
||||||
|
autocad(runningApp, subrole)
|
||||||
) && (
|
) && (
|
||||||
mustHaveIfJetbrainApp(runningApp, title, subrole, size!) &&
|
mustHaveIfJetbrainApp(runningApp, title, subrole, size!) &&
|
||||||
mustHaveIfSteam(runningApp, title, role) &&
|
mustHaveIfSteam(runningApp, title, role) &&
|
||||||
@@ -225,6 +226,11 @@ extension AXUIElement {
|
|||||||
return runningApp.localizedName == "scrcpy" && level == CGWindow.floatingWindow && role == kAXWindowRole && subrole == kAXStandardWindowSubrole
|
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? {
|
func position() throws -> CGPoint? {
|
||||||
return try value(kAXPositionAttribute, CGPoint.zero, .cgPoint)
|
return try value(kAXPositionAttribute, CGPoint.zero, .cgPoint)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -204,6 +204,9 @@ func SLSRequestScreenCaptureAccess() -> UInt8
|
|||||||
let kAXFullscreenAttribute = "AXFullScreen"
|
let kAXFullscreenAttribute = "AXFullScreen"
|
||||||
let kAXStatusLabelAttribute = "AXStatusLabel"
|
let kAXStatusLabelAttribute = "AXStatusLabel"
|
||||||
|
|
||||||
|
// for some reason, these attributes are missing from AXRoleConstants
|
||||||
|
let kAXDocumentWindowSubrole = "AXDocumentWindow"
|
||||||
|
|
||||||
enum CGSSymbolicHotKey: Int, CaseIterable {
|
enum CGSSymbolicHotKey: Int, CaseIterable {
|
||||||
case commandTab = 1
|
case commandTab = 1
|
||||||
case commandShiftTab = 2
|
case commandShiftTab = 2
|
||||||
|
|||||||
Reference in new issue
Block a user