cliclick icon indicating copy to clipboard operation
cliclick copied to clipboard

Fix macOS 15.0+ Compilation Error

Open codefuturist opened this issue 2 months ago • 0 comments

Problem

Project fails to compile on macOS 15.0+ due to deprecated CGWindowListCreateImage API:

Solution

Added compatibility layer that automatically uses the appropriate screen capture API based on runtime macOS version.

Changes

Makefile: Added deployment target and universal binary support • ColorPickerAction.m: Replaced deprecated API with compatibility wrapper • ScreenCaptureCompat.h/.m: New compatibility layer with runtime OS detection

Compatibility

macOS 12.3+: Uses CGDisplayCreateImageForRect • macOS 10.15-12.2: Falls back to CGWindowListCreateImage (warnings suppressed) • Architectures: Universal binary (x86_64 + arm64) • Deployment: macOS 10.15+

Testing

✅ Builds on macOS 15.0 with Xcode 16
✅ Color picker working: ./cliclick cp:100,1000 0 0
✅ All existing functionality preserved

No breaking changes - same CLI interface and behavior.

codefuturist avatar Oct 10 '25 16:10 codefuturist