Skip to content

Support image clipboard#6676

Draft
yume-chan wants to merge 1 commit intoGenymobile:devfrom
yume-chan:feat/image-clipboard
Draft

Support image clipboard#6676
yume-chan wants to merge 1 commit intoGenymobile:devfrom
yume-chan:feat/image-clipboard

Conversation

@yume-chan
Copy link
Contributor

Support bi-directional image clipboard synchronization.

The core concept is from my other project, but the code here is maybe 60% AI generated. Especially for the client, I don't know why it copies the data so many times.

Asynchronous Clipboard

SDL3 SDL_SetClipboardData supports asynchronous clipboard, meaning it can first give OS the metadata, then when OS wants to paste, supply the actual full data. In our case, the server can just tell the client about clipboard content changed, then when OS request the data, client sends another command to server to get the actual image data. But I haven't implemented that, so it now sends every image from server clipboard to the client.

Android has a similar concept, but requires a custom FileProvider. Since we can only use the standard file system FileProvider that's already in com.android.shell package, it now also requires sending every image from client device clipboard to server.

Protocol change

AI choose to use different command/message types for text and image clipboard, I think it's more clear on the protocol, but at the cost of some code duplication.

I didn't change the 256k max message size limit, both client and server will skip images larger than that with a warning.

Demo

Only tested on Linux

2026-02-13.17-48-28.mp4

@yume-chan yume-chan force-pushed the feat/image-clipboard branch from c9cc875 to 3c52506 Compare February 13, 2026 10:01
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.

1 participant