[client,x11] fix raw clipboard transfer between two clients - #13558
Open
yerbolgmailcom wants to merge 1 commit into
Open
yerbolgmailcom wants to merge 1 commit into
yerbolgmailcom wants to merge 1 commit into
Conversation
Since a60f2db ("remember available atoms in clipboard") client formats are only used if their atom was listed in the clipboard owner's TARGETS. When the owner is another FreeRDP client, data is transferred as CF_RAW (_FREERDP_RAW), which the owner never lists in TARGETS. The requester therefore never found the CF_RAW format, sent an empty format data response and pasting between two xfreerdp sessions stopped working. Look up CF_RAW without the available-atom filter, both when sending the selection request and when handling the reply. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
|
Can one of the admins verify this patch? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Copy and paste between two xfreerdp sessions running on the same X display no longer works. Copying text or an image in one session and pasting in the other pastes nothing. Copy and paste between each session and local applications still works.
This is a regression from a60f2db ("[client,x11] remember available atoms in clipboard"), included in 3.31.1, 3.32.0 and 3.32.1.
Cause
When the clipboard owner is another FreeRDP client, xfreerdp uses raw transfer: it reads the owner's format list from
_FREERDP_CLIPRDR_FORMATSand requests data asCF_RAW(_FREERDP_RAW). The owner never lists_FREERDP_RAWin itsTARGETS.Since a60f2db,
xf_cliprdr_server_format_data_request()looks up theCF_RAWclient format throughxf_cliprdr_get_client_available_format_by_id(), which skips formats whose atom was not in the owner'sTARGETS. The lookup always fails, so the client never callsXConvertSelection()and sends an empty Format Data Response to the server. The reply path (xf_cliprdr_get_requested_data(),xf_cliprdr_process_requested_data()and the INCRPropertyNotifyhandler) uses the same filtered lookup withrequestedFormatId == CF_RAW, so it would discard the raw data as well.Change
Look up
CF_RAWwithout the available-atom filter, both when sending the selection request and when handling the reply. Other formats still use the filtered lookup.How to test
/clipboardto two Windows hosts on the same X display.Validation
_FREERDP_CLIPRDRproperty but never sentConvertSelection. The owning client answered_FREERDP_RAWrequests from a test client for formats 1 and 13 within about 20 ms, including four at once.xfreerdpbuilds with no new warnings,git clang-formatmakes no changes andgit diff --checkpasses.🤖 Generated with Claude Code