Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clipboard updates #2766

Merged
merged 3 commits into from
Aug 9, 2023
Merged

Conversation

matt335672
Copy link
Member

Fixes #2763

This PR contains three commits

  1. The first of these adds more checking to a Format Data Response PDU. In particular, if the client responds with CB_RESPONSE_FAIL for any requested format, the X11 client is informed that the requested selection is not available, rather than the message being ignored. Additionally, pasted text is now given its own function, and more error checking is added.
  2. The second of these only advertises text to the X11 clients when a text format (or a file list) is advertised by the Windows client.
  3. The third of these is a tidy-up. There's a lot more that can be done in this area, but I've stuck with the minimum so that a backport to v0.9.x is feasible.

With these commits, when a picture is selected on the Windows client, the following can be seen using xclip:-

$ xclip -o -selection clipboard -t TARGETS
TARGETS
TIMESTAMP
MULTIPLE
image/bmp
$ xclip -o -selection clipboard -t STRING
Error: target STRING not available

Use the official Windows clipboard format names where appropriate

Replace g_file_format_id with g_file_group_descriptor_format_id
as the latter name is more descriptive of what is described in
[MS-ECLIP]
@metalefty
Copy link
Member

Thanks for the fix, I'll test. I think backport to v0.9 is necessary.

@matt335672
Copy link
Member Author

The patches I've added cherry-pick nicely on to v0.9, which is one reason I didn't make more changes in this area! I'll do some more tidy-ups on devel only.

Since the cherry-pick was so trivial, I've added #2767 against v0.9. Test whichever one works best for you and I'll apply any fixes to both.

@metalefty
Copy link
Member

LGTM.

% xclip -o -selection clipboard -t TARGETS
TARGETS
TIMESTAMP
MULTIPLE
image/bmp
% xclip -o -selection clipboard -t STRING
xclip: Error: window id 0x1c00001 cannot convert CLIPBOARD selection to target 'STRING'

@matt335672 matt335672 merged commit 67c297d into neutrinolabs:devel Aug 9, 2023
13 checks passed
@matt335672 matt335672 deleted the clipboard_updates branch August 9, 2023 13:39
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.

When the client clipboard contains an image, ConvertSelection(target="STRING") requests hang forever
2 participants