Xpra: Ticket #2689: Clipboard: Can't copy from gitk primary on Linux server to Windows client

Hi,

Found another clipboard issue...

Client: Windows 7, v4.0-r25796 Server: RHEL 7.7, v3.0.5-r24939

Client xpra.conf contains remote-clipboard=PRIMARY (see #2638 for full config)

Steps to reproduce:

gitk version is the version included with git 2.21.0 (gitk itself doesn't seem to have a --version flag or similar) Tk version: 8.5.13

Let me know if you need more info...



Tue, 31 Mar 2020 05:10:04 GMT - Antoine Martin: owner changed

Can you attach the -d clipboard log?


Tue, 31 Mar 2020 23:40:59 GMT - pm54389: attachment set


Tue, 31 Mar 2020 23:41:29 GMT - pm54389: attachment set


Tue, 31 Mar 2020 23:46:34 GMT - pm54389: owner changed

Attached. The logs show:


Wed, 01 Apr 2020 05:27:20 GMT - Antoine Martin: owner, status, description changed

Looks like the server log doesn't have -d clipboard? (I only see the client clipboard debug output in there) We should be sending a new token with the clipboard data every time the selection changes on the server, that's because mswindows clients are 'greedy' and won't be asking us for the clipboard contents when they're needed, so we have to ensure the contents are always up to date.


Wed, 01 Apr 2020 15:14:28 GMT - Antoine Martin: status changed; resolution set

I don't think there's much we can do about this.

Other well behaved applications will use XFixesSelectionNotify, ie with xterm:

do_xpra_xfixes_selection_notify_event(<X11:XFSelectionNotify
    {'send_event': '0', 'serial': '0x114fd', 'delivered_to': '0x400008',
     'window': '0x400008', 'subtype': '0', 'owner': '0x60002d',
     'selection': 'PRIMARY', 'timestamp': '238200596',
     'selection_timestamp': '238200595'
    }>)

That's how you're supposed to get clipboard change notifications... See Use XFixesSelectSelectionInput() from Xfixes extension and wait for XFixesSelectionNotify event.

As per the spec: The XFIXES Extension: Selection Tracking: Applications wishing to monitor the contents of current selections must poll for selection changes. XFIXES improves this by providing an event delivered whenever the selection ownership changes.

This notification was part of xfixes version 2, released sometime in the mid-2000s...

Without it, we would have to poll the clipboard continuously. That's horrible and we already blacklist any application that does that (ie: clipit), so not an option.


Thu, 02 Apr 2020 22:21:42 GMT - pm54389:

Ok, that makes sense, thanks. (Sorry about the logs - must have missed the -d clipboard on the server.)

I just found a page about the Cygwin clipboard that mentions this is a problem with Tk applications: https://x.cygwin.com/docs/ug/using-clipboard-integration.html


Sat, 23 Jan 2021 05:58:09 GMT - migration script:

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