-
Notifications
You must be signed in to change notification settings - Fork 309
Wayland backend: add host-to-client clipboard sync #1797
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
base: master
Are you sure you want to change the base?
Conversation
|
Thanks for doing this, I've been meaning to do it eventually, but never got around to it. To prevent stalling too much on reads, I just prevented it from reading more than once, and print out a message when it doesn't fit (see line 2516). I think it would be good for this to support all the same MIME types that the source supports (see lines 1228–1232 and 1240–1244; we should probably refactor these together so we don't triplicate the list of MIME types). However, more importantly, I think it should check the offered MIME types before getting the data. Currently, if I copy an image to the clipboard and try to paste it into gamescope, it just prints out some garbage, while I think it should either empty the internal clipboard or leave it unmodified. |
|
How about we merge this as is into main, renaming to plaintext host-to-client clipboard sync, given it's functional rn? We can work off this for the others after that. :] (For reference: https://patch-diff.githubusercontent.com/raw/ValveSoftware/gamescope/pull/1797.patch) |
|
The PR is still a draft so it needs to be finalized first before its able to be merged. (note: this is not a guarantee it would get merged on the gamescope side since thats not up to me, thats just the way draft PRs work) |
|
Is there a way to contribute to this PR without write-access to either? I assume I should make the PR to the draft's repo by adding it as a temp secondary upstream? (Not too sure what the correct way to do it is haha) Also in fairness I should probably start with: do we have a list of ALL the things we need to change before this is a full PR? |
|
BTW for reference: #1935 can act as the official ticket for this PR. Close it when this is finalised and merged. |
|
@ninetailedtori to work on it, I usually generate a .patch for the MR by adding I think addressing @MithicSpirit 's comment is probably a good start to get this running again, it can always be exoanded in future MRs. |
|
+1 for this |
|
I'll start to work on it today :) |
…re#1797 Signed-off-by: ninetailedtori <ninetailedtori@uwu.gal>
Pretty much right now, it's implemented in such a way that it will simply accept whatever is piped to the file descriptor, and there is no handler on the mime type directly. What we can do is expand our data offer handling to callback to complain if unsupported mime type to the source, and destroy the offer on our end, I suppose? I'll implement it roughly and rework it as I go along, probably in the spirit of traditional draft PR style I assume :] |
|
ninetailedtori@500d293 An attempt was made, I just gotta compile and test it, I welcome help from others to test it too though :) |
|
@nseguin42 do you need help testing this? I'm very much in need of this, as it makes gaming horrid without it in some games like WoW |
|
Hey, unfortunately I'm not able to work on this at the moment. I would
greatly appreciate if anyone is willing to adopt the patch and make it work.
…On Wed, Oct 22, 2025, 11:58 Jacob Reed ***@***.***> wrote:
*jacobrreed* left a comment (ValveSoftware/gamescope#1797)
<#1797 (comment)>
@nseguin42 <https://github.com/nseguin42> do you need help testing this?
I'm very much in need of this, as it makes gaming horrid without it in some
games like WoW
—
Reply to this email directly, view it on GitHub
<#1797 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABKQDUN3XT6FEDVGYBW4I5T3Y6SSHAVCNFSM6AAAAAB2Q7JZFCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZTIMZTGEZTENZSGM>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
|
@ninetailedtori are you driving this from here? |
|
I am, yes. Working on various projects right now but a functional gamescope Wayland h2c clipboard is one of my prios. The current draft patch from nseguin works but does not correctly decline handling of unsupported clip buffer content, and as a result instead of respecting the advertised mimetypes (as they added in the draft), either:
My existing work on top of it (which can be seen in my fork, linked by me in a prior message) might compile but it is a draft, and may still cause errors. To explain what I've done or intend to do:
I do welcome further testing on my PR, and it would be much appreciated, as I can only test so much on it! In terms of this draft PR, we can either continue here until my PR is fully functional and therefore moves to its own, or I can do as OP did and make my own draft PR and we may continue testing from there and eventually approve that thread. Up to how everyone would like it handled really, I'm not too sure what the PR etiquette is for handovers here :] It should be noted again that copy-paste ability of image or file or video content will not be implemented in this patch, as it is outside of the scope of this, and only will occur in a separate general scope issue to add more mimetypes to gamescope as a whole. The current intended behaviour is to log a warn and erase the data offer. |
|
Of note, wrt things I need to do:
|
Just ping me whenever you need testing, I'm down to test, looking at your diff, I see one issue, which may just be me, but |
Oh good catch, that's a typo, lemme fix that one quickly :] |
|
I'll be opening a new PR for this, so it allows everyone to keep a better track of it! Will mention this one when I request :] |
|
Just to chime in: just pulled master, merged and your PR works as expected, i can finally copy&paste server connections into cs2. please keep it up |
…re#1797 Signed-off-by: ninetailedtori <ninetailedtori@uwu.gal>
|
Please check my PR revival #2062, to see if it's stable! |
This PR adds the other half (host-to-client direction) of clipboard support for the Wayland backend (the client-to-host direction being added in e17aec4). In other words, it allows the gamescope client to paste from the host's clipboard.
--
The implementation is based on Emersion's blogpost from 2020: "Wayland clipboard and drag & drop" . In the post, Emersion writes (emphasis mine):
I'm not sure how to go about making this change, so I'd appreciate some input here.
--
Only the clipboard is supported (not the primary selection). Since the client-to-host direction supports the primary selection (c.f. ef1e8db), we should probably add this too.
--
Only the "text/plain" MIME type is requested. Should we request different MIME types?