This feature allows you to copy from outside the xpra session and paste inside it, and vice versa. For various reasons, this doesn’t always work quite as well as expected - see below for more details.
Platform specific issues:
Mac OSX and MS Windows clients only have a single clipboard selection whereas X11 has three: CLIPBOARD, PRIMARY and SECONDARY; therefore we need to choose which one to exchange with: see local-clipboard and remote-clipboard switches
on MS Windows, the OS requests the clipboard data as soon as we claim ownership
on MacOS, we have to use polling to see client-side changes
the HTML5 client can only access the clipboard when the browser decides it is appropriate to do so: usually following clicks or specific key combinations, it may also request permission once and this cannot be easily enabled afterwards once it has been denied
Wayland severely restricts access to the clipboard, making it impossible to synchronize it properly
Configuration Options
clipboard-direction: can be used to restrict the direction of the clipboard data transfers. This setting is also available from the system tray menu.
clipboard-filter-file: can be used to filter out clipboard contents using a file containing regular expressions
local-clipboard / remote-clipboard: can be used to select which clipboard selection to synchronize with
Technical Constraints
Clipboard support is an ongoing struggle.
You must ensure that there are no other clipboard synchronization tools already running as those are very likely to interfere and cause synchronization loops, wasted bandwidth, trigger application bugs, etc
In particular, avoid using the clipboard synchronization from your virtualization solution if you use one (ie: virtualbox, vmware, etc), or from tools like synergy. Alternatively, you can disable xpra’s clipboard instead. Just avoid running both at the same time.
Testing and debugging the clipboard
There is a debugging tool which can be launched using xpra clipboard-test.
The easiest way to test the clipboard on X11 platforms is to use xclip tool to set and verify the contents of each clipboard. * to set the “primary” clipboard contents to the string “primary”: shell echo _primary_ | xclip -i -selection primary * To print the contents of the “primary” clipboard: shell xclip -o -selection primary`
Note: on win32, you will need to change the clipboard currently in use to match the one you modify, this must be done before changing the value to ensure it is propagated.
The X11 clipboardAn overview of it’s problems and a proposed solution And here is a good quote from it: Clipboard sharing and network transparency: It’s nearly impossible to make the clipboard shared across different desktop computers. In fact it is possible, but such an implementation would be needlessly difficult and complex. The same can be said of support for virtualization (Qemu, Xen, VMWare). Sharing the clipboard between a virtual machine and the desktop itself is painfully difficult to implement correctly (in case X11 is running on the host operating system).
#41: when we support concurrent users on the same session, we currently give the clipboard to the first client - doing anything else will be quite tricky
#812 re-implement clipboard without gtk or nested main
#184 clipboard related bug, clipboard can fire at any time… so bugs may appear to come from somewhere else when in fact it is the clipboard that is the source of the problem - to keep in mind
#162 very hard to reproduce bug - relied on the list (and their order) of X11 atoms defined, as we tried to parse invalid values as X11 atoms