This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
BOOL canRecordScreen = YES; | |
if (@available(macOS 10.15, *)) { | |
canRecordScreen = NO; | |
NSRunningApplication *runningApplication = NSRunningApplication.currentApplication; | |
NSNumber *ourProcessIdentifier = [NSNumber numberWithInteger:runningApplication.processIdentifier]; | |
CFArrayRef windowList = CGWindowListCopyWindowInfo(kCGWindowListOptionOnScreenOnly, kCGNullWindowID); | |
NSUInteger numberOfWindows = CFArrayGetCount(windowList); | |
for (int index = 0; index < numberOfWindows; index++) { | |
// get information for each window |