Skip to content

Conversation

@codefuturist
Copy link

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.

Replace deprecated CGWindowListCreateImage with compatibility layer
that uses CGDisplayCreateImageForRect on modern systems and provides
runtime fallback for older macOS versions.

- Add ScreenCaptureCompat module for cross-version screen capture
- Update ColorPickerAction to use compatibility layer
- Set deployment target and universal binary support in Makefile
- Maintain backwards compatibility to macOS 10.15+
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant