rustdesk icon indicating copy to clipboard operation
rustdesk copied to clipboard

Shared Clipboard not Functioning with Wayland

Open mariaWitch opened this issue 1 year ago • 5 comments

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

mariaWitch avatar Mar 01 '23 23:03 mariaWitch

@fufesou

rustdesk avatar Mar 02 '23 01:03 rustdesk

How do I get the Wayland DE, please?

Dicer-J avatar Apr 10 '23 14:04 Dicer-J

Copy/Paste works if you copy/paste from an XWayland program. Would be neat if it would work from native Wayland apps too.

madsl avatar Apr 27 '23 20:04 madsl

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.

madsl avatar Apr 27 '23 20:04 madsl

Would love to have this fixed! :-)

muety avatar Jun 04 '23 11:06 muety

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.

ShellWen avatar Jul 15 '23 11:07 ShellWen

Might be relevant:

flatpak/xdg-desktop-portal/pull/852 flatpak/xdg-desktop-portal/issues/843

bayazidbh avatar Sep 04 '23 05:09 bayazidbh

/bounty $100

rustdesk avatar Sep 21 '23 10:09 rustdesk

💎 $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

algora-pbc[bot] avatar Sep 21 '23 10:09 algora-pbc[bot]

/attempt #3455

Options

ShellWen avatar Oct 02 '23 02:10 ShellWen

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.

beelchester avatar Nov 10 '23 23:11 beelchester

I don't know how KDE Connect do this. Anyone take a look?

ShellWen avatar Nov 11 '23 10:11 ShellWen

You can check their code https://github.com/KDE/kdeconnect-kde/tree/master/plugins/clipboard

beelchester avatar Nov 11 '23 10:11 beelchester

You can check their code https://github.com/KDE/kdeconnect-kde/tree/master/plugins/clipboard

I means control of mouse and keyboard.

ShellWen avatar Nov 11 '23 10:11 ShellWen

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

ShellWen avatar Nov 11 '23 11:11 ShellWen

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

beelchester avatar Nov 11 '23 11:11 beelchester

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?

ShellWen avatar Nov 11 '23 23:11 ShellWen

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.

beelchester avatar Nov 11 '23 23:11 beelchester

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.

cantalupo555 avatar Jun 10 '24 10:06 cantalupo555