Initial commit
This commit is contained in:
commit
d5c932d8e1
710 changed files with 50282 additions and 0 deletions
17
.tmp_axprobe/winlist.swift
Executable file
17
.tmp_axprobe/winlist.swift
Executable file
|
|
@ -0,0 +1,17 @@
|
|||
import Cocoa
|
||||
let px = Double(CommandLine.arguments[1])!, py = Double(CommandLine.arguments[2])!
|
||||
if let wins = CGWindowListCopyWindowInfo([.optionAll], kCGNullWindowID) as? [[String: Any]] {
|
||||
for w in wins {
|
||||
let name = w[kCGWindowOwnerName as String] as? String ?? "?"
|
||||
let title = w[kCGWindowName as String] as? String ?? ""
|
||||
let layer = w[kCGWindowLayer as String] as? Int ?? -1
|
||||
let pid = w[kCGWindowOwnerPID as String] as? Int ?? -1
|
||||
var b = CGRect.null
|
||||
if let d = w[kCGWindowBounds as String] as? [String: Any] {
|
||||
b = CGRect(x: d["X"] as! Double, y: d["Y"] as! Double, width: d["Width"] as! Double, height: d["Height"] as! Double)
|
||||
}
|
||||
let onTop = w[kCGWindowIsOnscreen as String] as? Bool ?? false
|
||||
let contains = b.contains(CGPoint(x: px, y: py))
|
||||
print("layer=\(layer) onScreen=\(onTop) pid=\(pid) owner=\(name) title=\(title) bounds=\(b) containsPoint=\(contains)")
|
||||
}
|
||||
}
|
||||
Loading…
Reference in a new issue