Creating screenshots on macOS Mojave without missing regions

121 Views Asked by At

I have some code to create screenshots. On High Sierra it worked without issues. However, it does not work anymore properly since I run it on Mojave. Some parts are cut out. I use this API call:

CGImageRef screenshot = CGWindowListCreateImage
(CGRectInfinite, kCGWindowListOptionOnScreenOnly, kCGNullWindowID, kCGWindowImageDefault);

This option didn't work too kCGWindowListOptionAll. Attached are snippets of the screenshots with regions that are just white, i.e. missing. Note, I have intentionally removed the docker part below. I would actually just want to create plain full-screen snapshots.

Furthermore, even using the command line tool screencapture the the result is the same. Any ideas? Do I need to give certain permissions in "Security & Privacy"?

enter image description here

enter image description here

0

There are 0 best solutions below