Fix macOS 15.0+ Compilation Error#195
Open
codefuturist wants to merge 1 commit into
Open
Conversation
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+
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.