Fix macOS 15.0+ Compilation Error #195
Open
+468
−11
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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,100→0 0 0✅ All existing functionality preserved
No breaking changes - same CLI interface and behavior.