Changed screen recording detection to use "at least one window name should be present)

This commit is contained in:
Michael Starke
2019-11-04 15:47:54 +01:00
parent ba538d05af
commit f10735f96f

View File

@@ -73,12 +73,9 @@
if(windowName) {
numberOfWindowsWithName++;
}
else {
break; //breaking early, numberOfWindowsWithName not increased
}
}
CFRelease(windowList);
BOOL canRecordScreen = (numberOfWindows == numberOfWindowsWithName);
BOOL canRecordScreen = (numberOfWindows == 0) || (numberOfWindowsWithName > 0);
if(!canRecordScreen && error) {
*error = [NSError errorInDomain:MPAutotypeErrorDomain withCode:MPErrorAutotypeIsMissingScreenRecordingPermissions description:NSLocalizedString(@"ERROR_NO_PERMISSION_TO_RECORD_SCREEN", "Error description for missing screen recording permissions")];
}