Repository navigation
Conversation
d563a04 to
e7841af
Compare
|
Hi i really feel this feature is must, as many clients (like remmina and others) support it by default, and many people are doing workarounds it Thanks |
It's draft because of this. |
|
Hello @ReenigneArcher um it have been more than a week but the moonlight lib c and qt didnt get merged nor reviewed, can you help me get some attention since you are a contributor there? Thanks |
ReenigneArcher
left a comment
There was a problem hiding this comment.
The packet framing and bounded clipboard callback parsing agree with moonlight-common-c #155, but the X11 backend has the four reproducible problems noted inline. Please fix these and add automated regression tests, including empty/maximum/truncated clipboard packets and subscription lifecycle behavior, as required by AGENTS.md. The new X11 implementation helpers and state members also need the required Doxygen documentation.
Validation: both complete PR diffs passed git diff --check; moonlight-common-c #155 built with UCRT64 in Debug, and focused sender/parser harnesses passed. A harness using this PR's exact clipboard.cpp with mocked X11 calls reproduced each inline finding. A full Sunshine build and real Xorg session were not run. Both PR heads are mergeable against their targets. CI awaits maintainer approval; the failing GH-Pages Read the Docs log ends with 'Timeout waiting for check runs', so that status is a verification limit rather than a contributor code finding.
|
The four X11 notes are fixed, and this branch is updated onto current master.
Tests cover empty, maximum, and truncated clipboard packets, plus subscription lifecycle, the None property, and INCR transfers. |
ReenigneArcher
left a comment
There was a problem hiding this comment.
The per-client subscriber tracking, unchanged initial snapshot, and property=None fixes now pass the focused checks, and small INCR transfers work through the actual watcher. The remaining INCR handshake defect below still prevents large host copies from reaching clients.
Validation: all 11 added clipboard helper tests passed in a focused UCRT64 gtest build using the exact PR helper code and real mailbox queues. Additional tests using the exact clipboard.cpp with mocked X11 calls passed the small-transfer and None-property cases, and reproduced the oversized-chunk stall and unsupported-type issue. The unchanged pinned moonlight-common-c sender/parser boundary harness passed again, and the complete PR diff passed git diff --check.
Verification limits: a full Sunshine build and real Xorg session were not run. Hosted CI, CodeQL, lint, and GH-Pages builds await maintainer approval; the current failed GH-Pages Read the Docs log ends with 'Timeout waiting for check runs'. These are separate from the code findings. The current head is mergeable against master.
A chunk larger than one X read stayed on the window, so the owner never sent the rest of a large copy. Unsupported INCR data was also published when the terminator arrived.
The quality gate failed on the declaration scope, the long test lambda, and an explicit vector type.
ReenigneArcher
left a comment
There was a problem hiding this comment.
Both findings from the previous review are fixed: oversized INCR properties are drained and acknowledged, and unsupported types during INCR are rejected without publishing their bytes. The earlier failing watcher regressions now pass. No additional runtime defect was found in the complete PR diff. The remaining requested change is the repository's required formatting cleanup noted inline.
Validation: the focused UCRT64 gtest build passed all 21 tests (17 PR clipboard tests and four additional watcher/helper regressions), including a 64 KiB INCR chunk, unsupported-type rejection, and the actual None-property responder. The pinned moonlight-common-c sender/parser boundary harness passed again. Both the follow-up diff and complete PR diff passed git diff --check. The pinned clang-format 23.1.0 --dry-run --Werror check fails in clipboard_sync.h and linux/clipboard.cpp; test_clipboard.cpp passes.
Verification limits: a full Sunshine build and real Xorg session were not run. Hosted CI, CodeQL, common lint, and GH-Pages builds still await maintainer approval; the current failed GH-Pages Read the Docs log ends with 'Timeout waiting for check runs'. Those pending checks are separate from the reproduced local formatting failure. The current head is mergeable against master.
The pinned clang-format check failed on the template keyword and the property read call.
The protocol no longer carries a token. Echoes are already ignored by comparing the text.
|
@ReenigneArcher the protocol review dropped the unused echo token, so this branch follows that in 40f4b83. The submodule points at moonlight-common-c f197f1d5. This stays a draft until that protocol pull request merges. |
Master already cleared these Sonar findings. The input constructor keeps the clipboard queue.
The watcher is split into smaller functions, and its thread stays joinable for the life of the process.
The selection targets are copied into the X buffer, and the event handler takes the watcher state in one argument.
|



Description
Add opt-in text clipboard sync for a Linux X11 host.
The client sends clipboard text with input packet
0x55000008. A zero-length packet subscribes and does not clear the host clipboard. Sunshine sends host clipboard text back on control message0x5505only after that subscribe. The host watcher uses the X11 CLIPBOARD selection and does not echo text it just applied. Text is capped at 32,755 bytes.Mac, Windows, and Linux builds without X11 still link. Their clipboard functions do nothing.
The submodule
third-party/moonlight-common-cpoints at moonlight-stream/moonlight-common-c#155 (cfd661028220a2c1bb8536cb49b2573f1a317f90). That commit is on the fork until the protocol pull request is merged.Tested on Ubuntu 24.04, Xorg, with a Moonlight Qt build that has Sync clipboard enabled. Copy works both ways. A stock Moonlight client still connects.
Screenshot
Issues Fixed or Closed
Roadmap Issues
Type of Change
Checklist
AI Usage
See our AI usage policy.