forked from nikitabobko/AeroSpace
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathBridged-Header.h
23 lines (20 loc) · 885 Bytes
/
Bridged-Header.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#ifndef Bridged_Header_h
#define Bridged_Header_h
#import <AppKit/AppKit.h>
// Alternative:
// func allWindowsOnCurrentMacOsSpace() {
// let options = CGWindowListOption(arrayLiteral: .excludeDesktopElements, .optionOnScreenOnly)
// let windowsListInfo = CGWindowListCopyWindowInfo(options, CGWindowID(0))
// let infoList = windowsListInfo as! [[String:Any]]
// let windows = infoList.filter { $0["kCGWindowLayer"] as! Int == 0 }
// print(windows.count)
// for window in windows {
// print(window)
// print("Name: \(window["kCGWindowOwnerName"].unsafelyUnwrapped)")
// print("PID: \(window["kCGWindowOwnerPID"].unsafelyUnwrapped)")
// print("window ID: \(window["kCGWindowNumber"])")
// print("---")
// }
// }
AXError _AXUIElementGetWindow(AXUIElementRef element, uint32_t *identifier);
#endif