Xpra: Ticket #1458: Clipboard is unreliable with thunderbird editor area

Running thunderbird on server, copying or pasting text from/into thunderbird's editor area not working most of the time.

In the test I've copied text from leafpad on the client to leafpad on server (successful), then another text from leafpad on the client to thunderbird on server (previous data is pasted). Then again (unsuccessful), then pasted to leafpad on server (successful), then pasted to thunderbird (after pasted to leafpad, successful).

So after using clipboard for the first time, I'm only being able to paste to thunderbird after I paste to something else.



Sat, 04 Mar 2017 08:38:08 GMT - psycho_zs: attachment set


Sat, 04 Mar 2017 08:38:20 GMT - psycho_zs: attachment set


Sun, 05 Mar 2017 17:54:55 GMT - Antoine Martin: status, component changed; milestone set

From the log samples: xpra X11 version 2.0-r15223 64-bit on Linux Debian 9.0 stretch.

Oh god, another clipboard bug..


Sun, 12 Mar 2017 11:27:56 GMT - Antoine Martin: owner, status changed

I cannot reproduce. The clipboard works for me everytime, in both directions. I've tried on Fedora 25 and Debian Stretch.

Maybe something is interfering with the clipboard on your client system? See wiki/Clipboard.

I cannot use the sample log files provided as I have no way of knowing which part of the log file relate to what: the communication is done via the X11 server's "selections", so all the events look pretty much the same.


Sat, 08 Apr 2017 11:45:54 GMT - Antoine Martin:

Please provide more succinct or annotated log samples, otherwise I will have to close this ticket as "worksforme".


Sat, 08 Apr 2017 23:38:56 GMT - psycho_zs:

I've isolated two events: I copy text from leafpad on client and unsuccessfully try to paste it into thunderbird on server. No clipboard manager running. Copied text was: 2:36: copy from leafpad client to tb server Attaching this part of server log and client output...


Sat, 08 Apr 2017 23:39:26 GMT - psycho_zs: attachment set

isolated copy+paste


Sat, 08 Apr 2017 23:39:38 GMT - psycho_zs: attachment set

isolated copy+paste


Thu, 13 Apr 2017 13:11:53 GMT - Antoine Martin:

OK, so that's quite a bit clearer. We see lots of:

process clipboard request, request_id=11, selection=CLIPBOARD, local name=CLIPBOARD, target=TARGETS

That's the application requesting the list of targets for the clipboard. (the list of formats we can supply for this clipboard)

We dutifully respond every time with the list:

['TIMESTAMP', 'TARGETS', 'MULTIPLE', 'GTK_TEXT_BUFFER_CONTENTS', \
    'application/x-gtk-text-buffer-rich-text', 'UTF8_STRING', 'TEXT', 'STRING',  \
    'text/plain;charset=utf-8', 'text/plain']

But then we get a request that doesn't make any sense:

process clipboard request, request_id=14, selection=CLIPBOARD, local name=CLIPBOARD, target=application/x-moz-nativehtml

As it uses a target ("application/x-moz-nativehtml") we have not advertised. And when forward it to the application, it responds with "no data":

unpack(..) type=, format=0, data=<type 'NoneType'>:0

Which is expected since we're requesting a target it knows nothing about.

And this rings a bell:

The patch above was not applicable as it is: some applications may provide the "x-moz-nativehtml" target, so we should only translate this target if it isn't going to work. r15589 does that, it also exposes the targets we have last sent via xpra info:

$ xpra info | grep last-targets

@psycho_zs: does that work for you now?


Thu, 11 May 2017 05:02:31 GMT - Antoine Martin:

Not heard back, closing.


Wed, 24 May 2017 07:10:15 GMT - Antoine Martin: status changed; resolution set


Mon, 05 Jun 2017 19:46:13 GMT - psycho_zs:

Formatting is lost on paste, e.g. when copying from LibreOffice? on client to Thunderbird on server.

Also I can not paste anything formatted copied from Firefox. And clipboard stops working after such attempt. E.g. when copying a random couple dozen lines from this ticket page.

BTW, this can be related: #1458


Mon, 05 Jun 2017 19:46:46 GMT - psycho_zs: attachment set

firefox@client to thunderbird@server


Mon, 05 Jun 2017 19:47:51 GMT - psycho_zs: status changed; resolution deleted

reopening.


Sat, 01 Jul 2017 06:25:10 GMT - Antoine Martin: milestone changed

Formatting is lost on paste, e.g. when copying from LibreOffice?? on client to Thunderbird on server. Also I can not paste anything formatted copied from Firefox.

That's a different issue, please file another ticket and link back here. It could well be because we are now filtering the invalid target application/x-moz-nativehtml.

And clipboard stops working after such attempt. E.g. when copying a random couple dozen lines from this ticket page.

Works for me, though after repeated copying I saw one of those two warnings in the server log and the clipboard was then disabled (as per the message):

clipboard disabled: more than %s clipboard requests per second!
Warning: loop nesting too deep: 10
 you may have a clipboard forwarding loop, disabling the clipboard

That's because thunderbird and Firefox make dozens of clipboard requests for a single paste... so r16146 tolerates more clipboard requests per second before giving up: waiting for sustained requests and tolerating more bursts, r16147 also raises the loop nesting limit to 20.

This should help a bit, but don't expect miracles: what those apps are doing with the clipboard is really pushing it.


Wed, 12 Jul 2017 12:19:30 GMT - Antoine Martin: status changed; resolution set


Sat, 23 Jan 2021 05:24:50 GMT - migration script:

this ticket has been moved to: https://github.com/Xpra-org/xpra/issues/1458