-
-
Notifications
You must be signed in to change notification settings - Fork 182
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
Add Clipboard support for RemoteDesktop via org.freedesktop.portal.Clipboard #852
Conversation
92d4dc3
to
01ac995
Compare
It it possible to use this without RemoteDesktop? I believe a Clipboard portal would be useful on its own, as a more convenient way to interact with the clipboard on Wayland. |
Why would you want that? Clipboard in the form that remote desktop applications need should not be exposed to applications for convenience, since it avoids limiting clipboard content to the focused application and user interaction on that application. Doing that has very large privacy implications. |
One example I have in mind is a translation app that has a feature to translate selected text and put translation back to clipboard; this can be triggered without interacting with the app main window, via hotkey or tray icon menu.
I suppose user has to grant the app permission to interact with clipboard first? |
Yes. We certainly don't want applications to control a user's clipboard without their consent.
In #843 it was mentioned that this interface could be useful for the |
Sorry, I don't know anything about the proposed |
131978e
to
a3c8d06
Compare
@jadahl, there hasn't been any progress on this PR for awhile, is there anything I should do to get some feedback on it? |
I'll try to do a round of review as soon as I can. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Haven't looked close at the actual C code yet, as if we're dropping the Request method dance, it'll likely look different enough to invalidate any review I do today.
343c371
to
9130a52
Compare
@jadahl, thanks for your first review! I think I've addressed all your comments now, if you have time for another round 😄 |
I've read through the changes and the proposed API makes sense to me. I feel there should be further documentation on the expected order of events after the In that regard, I mildly wonder if passing an FD should be implicitly considered success, writing on an end of a pipe accounts on the other side reading or the pipe will grow full and writes will stall, and having to wait to the end of the transfer for a |
Since the portal clipboard API here is based on the private clipboard API between mutter and g-r-d, there is something to note here: There are thoughts about changing the For the portal API we probably wanna change the handling in that direction, so that mutter would not have two paths for handling selection writes and their results. |
Since this is only about remote desktop sessions, I don't think it should be called org.freedesktop.portal.Clipboard. That name is confusing and implies that this also covers local clipboards, which are handled via display server protocols already. |
This is not a separate clipboard portal, but a way to hook up clipboard to the remote desktop portal. Since we might want clipboard to other portals (e.g. input capture), it makes sense to keep it separate, and not tied to remote desktop, otherwise we need to copy paste the whole API in every place its used, including follow up fixes / changes. |
347d3a2
to
c8d8cc9
Compare
2cdf320
to
d889238
Compare
Thanks @scmv! I've updated the serials in SelectionWrite to use |
@jadahl I added some tests and finished your last code review |
fyi I think this PR is just waiting for more maintainers to chime in with any thoughts |
This needs a rebase to drop the autotools parts. |
d889238
to
9c1ceb8
Compare
Done! |
9c1ceb8
to
c868316
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is more or less ready to land. I'd like to go back to a simpler previous version (see comment about SelectionWrite(Done) about what/why), but other than that it seems ready.
f323720
to
5ec1b5a
Compare
6c5b5d1
to
b8b92d2
Compare
@jadahl Done! |
Remove some state that didn't help much keeping track of separately. We'll want to be able to prepare more in an arbitrary order before starting so just have a single state for not having started (`INIT`).
Add an interface to allow sessions to interact with the clipboard (in particular, the remote desktop session.)
b8b92d2
to
2f9d453
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Everything lgtm. Planning to land this within some days, e.g. monday next week, if no-one objects before that.
This PR is to add clipboard controls for RemoteDesktop as described in #843.
xdg-desktop-portal-gnome
Fix #843