ronaldoussoren / pyobjc

The Python <-> Objective-C Bridge with bindings for macOS frameworks
https://pyobjc.readthedocs.io
563 stars 47 forks source link

Quartz module fails to build on macOS 15: CGWindowListCreateImageFromArray is unavailable #627

Closed breun closed 3 weeks ago

breun commented 4 weeks ago

Describe the bug

Why I try to build the PyObjC Quartz module on macOS 15, I get this error:

Modules/_coregraphics.m:243:17: error: 'CGWindowListCreateImageFromArray' is unavailable: obsoleted in macOS 15.0 - Please use ScreenCaptureKit instead.
  243 |                 CGWindowListCreateImageFromArray(screenBounds, windowArray, imageOption);
      |                 ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGWindow.h:280:33: note: 'CGWindowListCreateImageFromArray' has been explicitly marked unavailable here
  280 | CG_EXTERN CGImageRef __nullable CGWindowListCreateImageFromArray(
      |                                 ^

Platform information

To Reproduce Build the PyObjC Quartz module on macOS 15.

Expected behavior I expect the build to succeed without errors.

breun commented 4 weeks ago

I found a workaround for MacPorts by setting the deployment target to macOS 14: https://trac.macports.org/wiki/SequoiaProblems#ScreenCaptureKitRequirementwithmacOS15SDK

ronaldoussoren commented 3 weeks ago

Thanks for the report. I generally build with the Python.org installations of Python and hadn't seen this problem yet.