Skip to content

fix: weak-link ScreenCaptureKit in Screenshot plugin for macOS 14/15 compatibility - #558

Open
mvanhorn wants to merge 1 commit into
mactools-app:mainfrom
mvanhorn:fix/557-screenshot-weak-link-screencapturekit
Open

mvanhorn wants to merge 1 commit into
mactools-app:mainfrom
mvanhorn:fix/557-screenshot-weak-link-screencapturekit

Conversation

@mvanhorn

Copy link
Copy Markdown
Contributor

Problem and result

MacTools cannot load the Screenshot plugin on macOS 14 or 15, so users cannot take screenshots with it. The plugin linked ScreenCaptureKit strongly, making SCScreenshotConfiguration a required symbol even though only the macOS 26 capture path uses it. On macOS 14 and 15, dyld fails to resolve that class before the runtime availability check can select the older capture path.

The Screenshot plugin now weak-links ScreenCaptureKit. The existing availability check calls a macOS 26-only helper for rectangle capture, while earlier systems use the existing display capture path. A regression test checks the generated linker flags for ScreenshotPluginCore, ScreenshotPlugin, and MacToolsTests.

Closes #557

Changes

Covered in the summary above.

Verification

pytest -q scripts/tests/test_generate_plugin_schemes.py passed all 11 tests, including the new linker flag check.
swift_tests found no Swift package for the changed files and ran no Swift tests.
The tests in scripts/tests/test_generate_plugin_schemes.py fail without the fix in the MacTools CapturePipeline change (checked by reverting the source changes).

UI evidence

Not applicable to this change.

Checklist

  • Core behavior and relevant risks are verified using existing tests, focused additions, or manual checks; results or limitations are recorded.
  • UI evidence is attached where applicable; shared components, themes, localization, and accessibility are respected.
  • User-facing documentation and changelog fragments are updated when required.
  • Plugin metadata, runtime contracts, action policies, and minimum-host compatibility agree.
  • Licensing and third-party notices are complete; no credentials, local configuration, or unrelated generated files are included.

AI was used for assistance.

…compatibility

The Screenshot plugin now weak-links ScreenCaptureKit. The existing
availability check calls a macOS 26-only helper for rectangle capture,
while earlier systems use the existing display capture path. A
regression test checks the generated linker flags for
ScreenshotPluginCore, ScreenshotPlugin, and MacToolsTests.

Fixes mactools-app#557
@ggbond268

Copy link
Copy Markdown
Collaborator

Thanks for the compatibility fix! The weak-linking change and availability guard look good, and all 11 generator tests pass.

One small item before merging: please add a short English changelog fragment under changes/unreleased/ with release: plugin and type: fixed, since this is a user-visible fix. Suggested wording: “Fixed Screenshot plugin compatibility with macOS 14 and 15.”

I couldn't verify plugin loading and capture on macOS 14/15 locally, so a quick check on those versions would also be helpful. Thanks!

This branch has not been deployed

No deployments
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.

[Bug] Screenshot plugin (1.2.0) fails to load on macOS 15: Symbol not found _OBJC_CLASS_$_SCScreenshotConfiguration

2 participants