Image copy fix#394
Conversation
- clipboard-manager.ts: merge changeCount optimisation (from this branch) with the expanded image-format support from main (#391). Use readClipboardBufferForFormats for GIF check, keep fallbackImage in destructuring, and carry the O(1) getPasteboardChangeCount early-exit. - native_helpers.mm: export both getPasteboardChangeCount (this branch) and setWindowAnimationBehaviorNone (main); update loader to use native_helpers.node (renamed in #392) via getNativeHelpersAddon(). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5d1f1c0328
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| const addon = getNativeHelpersAddon(); | ||
| if (addon?.getPasteboardChangeCount) { | ||
| lastPasteboardChangeCount = addon.getPasteboardChangeCount(); | ||
| } |
There was a problem hiding this comment.
Seed image state when pasteboard addon is unavailable
This startup path now relies entirely on getPasteboardChangeCount(), but getNativeHelpersAddon() explicitly falls back to null when the native module cannot be loaded. In that fallback case, lastClipboardImageHash is no longer initialized from the current clipboard image, so the immediate pollClipboard() call treats any pre-existing image as a new copy and adds a spurious history entry on launch. This regresses the previous behavior for environments where native_helpers.node is missing or fails to load (e.g., architecture/build mismatch).
Useful? React with 👍 / 👎.
No description provided.