Update: cleary some code style

This commit is contained in:
vcaesar 2024-09-17 12:59:15 -07:00
parent 5b9871b063
commit cb51e2aa10

View File

@ -24,6 +24,7 @@
dispatch_semaphore_signal(semaphore); dispatch_semaphore_signal(semaphore);
return; return;
} }
SCDisplay* target = nil; SCDisplay* target = nil;
for (SCDisplay *display in content.displays) { for (SCDisplay *display in content.displays) {
if (display.displayID == id) { if (display.displayID == id) {
@ -41,16 +42,18 @@
config.sourceRect = diIntersectDisplayLocal; config.sourceRect = diIntersectDisplayLocal;
config.width = diIntersectDisplayLocal.size.width; config.width = diIntersectDisplayLocal.size.width;
config.height = diIntersectDisplayLocal.size.height; config.height = diIntersectDisplayLocal.size.height;
[SCScreenshotManager captureImageWithFilter:filter [SCScreenshotManager captureImageWithFilter:filter
configuration:config configuration:config
completionHandler:^(CGImageRef img, NSError* error) { completionHandler:^(CGImageRef img, NSError* error) {
if (!error) { if (!error) {
image1 = CGImageCreateCopyWithColorSpace(img, colorSpace); image1 = CGImageCreateCopyWithColorSpace(img, colorSpace);
} }
dispatch_semaphore_signal(semaphore); dispatch_semaphore_signal(semaphore);
}]; }];
} }
}]; }];
dispatch_semaphore_wait(semaphore, DISPATCH_TIME_FOREVER); dispatch_semaphore_wait(semaphore, DISPATCH_TIME_FOREVER);
dispatch_release(semaphore); dispatch_release(semaphore);
return image1; return image1;