Fix clipboard image paste on Linux #12

Merged
Lemarkis merged 1 commit from fix/clipboard-image-paste-linux into main 2026-09-14 09:21:22 +00:00
Owner

Summary

  • WebKitGTK (the Linux webview) never exposes clipboard image data (e.g. a screenshot) through ClipboardEvent.clipboardData - only the file/text paste path worked there. WebView2 (Windows) and WKWebView (macOS) already worked fine via the existing standard paste-event path.
  • Added @tauri-apps/plugin-clipboard-manager and fall back to its native readImage() (goes straight to the OS clipboard, bypassing the webview entirely) whenever the standard paste event comes up empty - the RGBA buffer it returns is drawn onto a <canvas> and exported as a PNG blob, reusing the existing image-insert pipeline.
  • Added the clipboard-manager:allow-read-image capability (was missing, so the IPC call would've been silently blocked).
  • Added a CHANGELOG.md entry.

Test plan

  • npm run check (0 errors, 0 warnings)
  • npm run test (101 passed)
  • cargo build compiles cleanly
  • Manually confirmed: pasting a screenshot into a note now works on Linux (previously silently did nothing)

🤖 Generated with Claude Code

## Summary - WebKitGTK (the Linux webview) never exposes clipboard image data (e.g. a screenshot) through `ClipboardEvent.clipboardData` - only the file/text paste path worked there. WebView2 (Windows) and WKWebView (macOS) already worked fine via the existing standard paste-event path. - Added `@tauri-apps/plugin-clipboard-manager` and fall back to its native `readImage()` (goes straight to the OS clipboard, bypassing the webview entirely) whenever the standard paste event comes up empty - the RGBA buffer it returns is drawn onto a `<canvas>` and exported as a PNG blob, reusing the existing image-insert pipeline. - Added the `clipboard-manager:allow-read-image` capability (was missing, so the IPC call would've been silently blocked). - Added a `CHANGELOG.md` entry. ## Test plan - [x] `npm run check` (0 errors, 0 warnings) - [x] `npm run test` (101 passed) - [x] `cargo build` compiles cleanly - [x] Manually confirmed: pasting a screenshot into a note now works on Linux (previously silently did nothing) 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Fix clipboard image paste on Linux
All checks were successful
CI / frontend (pull_request) Successful in 27s
CI / backend (pull_request) Successful in 5m58s
8eac52fa4e
WebKitGTK never exposes clipboard image data (e.g. a screenshot) through
ClipboardEvent.clipboardData - only the file/text paste path worked there,
unlike WebView2/WKWebView where the existing code already worked. Add
@tauri-apps/plugin-clipboard-manager and fall back to its native
readImage() (straight to the OS clipboard, bypassing the webview) whenever
the standard paste event comes up empty.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Lemarkis deleted branch fix/clipboard-image-paste-linux 2026-09-14 09:21:22 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Lemarkis/Mark-it!12
No description provided.