Skip to content

Add paste image from Mac to linux wayland - #23

Open
heavysink wants to merge 1 commit into
J-x-Z:mainfrom
heavysink:main
Open

Add paste image from Mac to linux wayland#23
heavysink wants to merge 1 commit into
J-x-Z:mainfrom
heavysink:main

Conversation

@heavysink

Copy link
Copy Markdown

For now, cocoa-way does not support pasting image via wayland. I tried to create the patch so that pasting image via shell is possible. It is helpful for remote codex session.

@J-x-Z

J-x-Z commented Jul 23, 2026

Copy link
Copy Markdown
Owner

Thanks for working on macOS-to-Wayland image clipboard support is useful,
and I would like to merge the feature after a few issues are addressed。


  1. NSData should use data.to_vec() rather than
    data.bytes().to_vec().

  1. poll_host_clipboard() currently calls pasteboard_snapshot() before
    checking whether changeCount changed. Since the snapshot may decode TIFF
    and encode PNG, this can repeat expensive image conversion every 100 ms
    while the clipboard is unchanged. Please check changeCount first and only
    read/convert the image when it changes.

  1. Please avoid cloning the complete PNG for every Wayland request. Storing it
    as Arc<[u8]> and adding a reasonable maximum clipboard image size would
    prevent large memory spikes.

Please also confirm that text clipboard behavior, clipboard clearing, and pasting a macOS screenshot into a Wayland application have been tested.

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