Skip to content

fix: clipboard image paste on Linux WebKitGTK + Ctrl+Shift+V shortcut#6

Merged
craig7351 merged 2 commits into
craig7351:mainfrom
ChrisLi826:feat/fix-clipboard-image-paste-webkit
May 12, 2026
Merged

fix: clipboard image paste on Linux WebKitGTK + Ctrl+Shift+V shortcut#6
craig7351 merged 2 commits into
craig7351:mainfrom
ChrisLi826:feat/fix-clipboard-image-paste-webkit

Conversation

@ChrisLi826
Copy link
Copy Markdown

@ChrisLi826 ChrisLi826 commented May 11, 2026

Summary

  • Fix clipboard image paste silently doing nothing on Linux WebKitGTK: ClipboardEvent.clipboardData.items never surfaces image MIME types on WebKitGTK, so the previous hasImage guard always returned false. Now delegates image detection entirely to the native arboard backend (clipboard_save_image already returns null when no image is present).
  • Add Ctrl+Shift+V as an explicit image-paste shortcut that bypasses the paste event entirely, covering cases where WebKitGTK does not fire a paste event for image-only clipboard content.
  • Add tauri.conf.dev.json for building a parallel BOOKSHELLDEV app (different identifier) that can coexist with the production build.

Test plan

  • Press PrtSc to capture screenshot
  • Focus terminal and press Ctrl+V — path to saved PNG should be inserted
  • Press PrtSc again, press Ctrl+Shift+V — same result
  • Verify text paste (Ctrl+V with text in clipboard) still works normally
  • Verify SSH tab uploads image to remote and inserts remote path

🤖 Generated with Claude Code

ChrisLi and others added 2 commits May 11, 2026 13:14
…tcut

WebKitGTK never surfaces image MIME types in ClipboardEvent.clipboardData.items,
so the previous hasImage guard always returned false and the paste handler was
silently skipped. Fix by removing the guard and delegating detection entirely to
the native arboard backend (clipboard_save_image already handles the no-image case).

Also add Ctrl+Shift+V as an explicit image-paste shortcut that bypasses the paste
event entirely, covering cases where WebKitGTK doesn't fire a paste event for
image-only clipboard content.

Add tauri.conf.dev.json for building a parallel BOOKSHELLDEV app (different
identifier) that can coexist with the production build.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…tGTK hangs

- Use a persistent clipboard worker thread (arboard) for text writes so
  X11 keeps responding to SelectionRequest events after set_text returns
- Add clipboard_read_text command for reading text back without WebKit
- Ctrl+Shift+V now falls back to text paste when clipboard holds no image
- Guard onMouseUp auto-copy to left-click only (button === 0) so
  middle-click no longer overwrites clipboard and breaks primary paste

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@craig7351 craig7351 merged commit 16e5df9 into craig7351:main May 12, 2026
3 checks passed
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.

2 participants