rustdesk
rustdesk copied to clipboard
Shared Clipboard not Functioning with Wayland
Bug Description
The shared clipboard does not seem to function between my host and my client, when the client is running on Wayland DE. (Note this is occurring on the latest passing nightly build (Build #203 in the project actions) so it may also be a more wide spread problem.)
How to Reproduce
Connect to a client that is running a Wayland Compatible version of Rustdesk. Attempt to copy text from host to client, or vice versa.
Expected Behavior
The clipboard should be shared between both clients.
Operating system(s) on local side and remote side
Windows 11 -> Ubuntu 22.04 (Linux 6.2.1)
RustDesk Version(s) on local side and remote side
1.1.9 -> 1.2.0 (The most recent passing Nightly artifact)
Screenshots
N/A
Additional Context
No response
@fufesou
How do I get the Wayland DE, please?
Copy/Paste works if you copy/paste from an XWayland program. Would be neat if it would work from native Wayland apps too.
Tip: If you start e.g. kwrite like this
QT_QPA_PLATFORM=xcb kwrite
then you can use that window to copy/paste to and from.
Would love to have this fixed! :-)
The current workaround for this issue is to use GDK_BACKEND=x11 rustdesk
to force RustDesk to run within XWayland, which helps alleviate the problem.
Might be relevant:
flatpak/xdg-desktop-portal/pull/852 flatpak/xdg-desktop-portal/issues/843
/bounty $100
💎 $100 bounty created by rustdesk
🙋 If you start working on this, comment /attempt #3455
to notify everyone
👉 To claim this bounty, submit a pull request that includes the text /claim #3455
somewhere in its body
📝 Before proceeding, please make sure you can receive payouts in your country
💵 Payment arrives in your account 2-5 days after the bounty is rewarded
💯 You keep 100% of the bounty award
🙏 Thank you for contributing to rustdesk/rustdesk!
Attempt | Started (GMT+0) | Solution |
---|---|---|
🟢 @ShellWen | Oct 2, 2023, 2:17:03 AM | WIP |
https://github.com/rustdesk/rustdesk/pull/5900 seems to be lacking compatibility.
I think using the remote desktop portal (org.freedesktop.portal.RemoteDesktop
) can be a good option.
https://flatpak.github.io/xdg-desktop-portal/docs/#gdbus-org.freedesktop.portal.RemoteDesktop
It has support for clipboard.
Currently, we are only using org.freedesktop.portal.ScreenCast
for the pipewire session.
https://github.com/rustdesk/rustdesk/blob/45dbea57f1c509875e4340254eeb252c657e15a1/libs/scrap/src/wayland/pipewire_dbus.rs#L35
On the other hand, using org.freedesktop.portal.RemoteDesktop
will also fix input on flatpak wayland https://github.com/rustdesk/rustdesk/issues/5949 (This issue also has a bounty) as it supports the transfer of input events to an EIS, you might have to do separate implementation for libei to further emulate inputs.
uinput
might not be needed anymore.
You can check this too for understanding. https://github.com/rustdesk/rustdesk/issues/56#issuecomment-863654049 https://github.com/rustdesk/rustdesk/discussions/4906: Teamviewer also seems to be using it. https://github.com/rustdesk/rustdesk/issues/3455#issuecomment-1704654383
@ShellWen and others interested can have a look at it. You might fix two issues at once.
@fufesou please verify if using org.freedesktop.portal.RemoteDesktop
can be feasible or not.
I don't know how KDE Connect do this. Anyone take a look?
You can check their code https://github.com/KDE/kdeconnect-kde/tree/master/plugins/clipboard
You can check their code https://github.com/KDE/kdeconnect-kde/tree/master/plugins/clipboard
I means control of mouse and keyboard.
You can check their code https://github.com/KDE/kdeconnect-kde/tree/master/plugins/clipboard
I means control of mouse and keyboard.
It is over here: https://github.com/KDE/kdeconnect-kde/blob/master/plugins/mousepad/waylandremoteinput.cpp
I suspect they are using org.freedesktop.portal.RemoteDesktop
https://github.com/rustdesk/rustdesk/issues/3455#issuecomment-1806570986
https://github.com/KDE/kdeconnect-kde/blob/14192dd9c463ffa40d0cb66a2631395432d37517/plugins/mousepad/waylandremoteinput.cpp#L62
I suspect they are using
org.freedesktop.portal.RemoteDesktop
#3455 (comment) https://github.com/KDE/kdeconnect-kde/blob/14192dd9c463ffa40d0cb66a2631395432d37517/plugins/mousepad/waylandremoteinput.cpp#L62
Another problem: is this work under systemd unit?
I'm not sure but using org.freedesktop.portal.RemoteDesktop
will not require root access (couldn't find the need for root in the doc), even for emulating input events libei might not require root permission unlike uinput.
We are already using org.freedesktop.portal.ScreenCast
. org.freedesktop.portal.RemoteDesktop
just provides more features on top of it, so it shouldn't be a problem.
The current workaround for this issue is to use
GDK_BACKEND=x11 rustdesk
to force RustDesk to run within XWayland, which helps alleviate the problem.
Thank you.