Xpra: Ticket #2638: Clipboard: Copying from Windows client to Linux server stopped working after upgrade

Hi,

Client: Windows 7, v3.0.6-r25205 Server: RHEL 7.6, v3.0.5-r24939

After upgrading the client from v2.4.2-r21077 to v3.0.6, copy/paste from Windows (client) to Linux (server) stopped working.

Steps to reproduce:

In the last step, it should paste "text3".

Downgrading the client back to v2.4.2 (same xpra.conf) fixes the issue, but only after the server is restarted.

I tried many combinations of clipboard settings on client and server (--clipboard, --remote-clipboard, --local-clipboard, --clipboard-direction), but none of these fixed it.

In case it's relevant:

Let me know if you need more info.

Client xpra.conf:

remote-clipboard=PRIMARY
opengl=0
ssh=paramiko
encoding=rgb
min-speed=70
title=@title@
modal-windows=no

Server log during the copy/paste operations described above:

[36m2020-03-11 16:07:32,981 client   1 @53.633 clipboard event: CLIPBOARDUPDATE[0m
[36m2020-03-11 16:07:32,983 client   1 @53.634 schedule_emit_token() elapsed=694232205 (max=100)[0m
[36m2020-03-11 16:07:32,983 client   1 @53.634 _send_clipboard_token_handler(Win32ClipboardProxy, '()')[0m
[36m2020-03-11 16:07:32,983 client   1 @53.634 clipboard_send: clipboard-token[0m
[36m2020-03-11 16:07:32,984 process clipboard token selection=CLIPBOARD, local clipboard name=CLIPBOARD, proxy=X11ClipboardProxy(CLIPBOARD)[0m
[36m2020-03-11 16:07:32,984 got token, selection=CLIPBOARD, targets=None, target data=None, claim=True, can-receive=True[0m
[36m2020-03-11 16:07:32,985 claim_selection: set selection owner returned 1, owner=0x40001e[0m
2020-03-11 16:07:32,985 client   1 @53.637 unknown string message: 0xc188 / 0x52 / 0x11ff[0m
[36m2020-03-11 16:07:32,985 claim_selection: sending message to root window[0m
2020-03-11 16:07:32,985 client   1 @53.638 unknown string message: 0xc188 / 0x50 / 0x0[0m
[36m2020-03-11 16:07:32,986 claim_selection: done, owned=True[0m
[36m2020-03-11 16:07:32,986 client   1 @53.638 remove_block: CLIPBOARD[0m
[36m2020-03-11 16:07:32,987 do_xpra_xfixes_selection_notify_event(<X11:XFSelectionNotify {'delivered_to': '0x40001e', 'send_event': '0', 'selection': 'CLIPBOARD', 'timestamp': '478056704', 'owner': '0x40001e', 'subtype': '0', 'window': '0x40001e', 'selection_timestamp': '478056704', 'serial': '0x5cd'}>)[0m
[36m2020-03-11 16:07:32,987 do_selection_notify_event(<X11:XFSelectionNotify {'delivered_to': '0x40001e', 'send_event': '0', 'selection': 'CLIPBOARD', 'timestamp': '478056704', 'owner': '0x40001e', 'subtype': '0', 'window': '0x40001e', 'selection_timestamp': '478056704', 'serial': '0x5cd'}>) owned=True, was True, enabled=True, can-send=True[0m
[36m2020-03-11 16:07:35,057 do_xpra_selection_request(<X11:SelectionRequest {'delivered_to': '0x40001e', 'send_event': '0', 'selection': 'PRIMARY', 'target': 'UTF8_STRING', 'requestor': '0x600026', 'window': '0x40001e', 'time': '478058776', 'serial': '0x693', 'property': '_XT_SELECTION_0'}>)[0m
[36m2020-03-11 16:07:35,057 do_selection_request_event(<X11:SelectionRequest {'delivered_to': '0x40001e', 'send_event': '0', 'selection': 'PRIMARY', 'target': 'UTF8_STRING', 'requestor': '0x600026', 'window': '0x40001e', 'time': '478058776', 'serial': '0x693', 'property': '_XT_SELECTION_0'}>)[0m
[36m2020-03-11 16:07:35,058 clipboard request for PRIMARY from window 0x600026: child of 'xterm', target=UTF8_STRING, prop=_XT_SELECTION_0[0m
[36m2020-03-11 16:07:35,059 send_clipboard_request_handler(X11ClipboardProxy(PRIMARY), 'PRIMARY', 'UTF8_STRING')[0m
[36m2020-03-11 16:07:35,059 send_clipboard_request id=0[0m
[36m2020-03-11 16:07:35,059 sending clipboard-pending-requests=1 to ClientConnection(1 : Protocol(unix-domain socket:/run/user/2129/xpra/redacted-1338))[0m
[36m2020-03-11 16:07:35,064 client   1 @55.716 process_clipboard_packet: clipboard-request, helper=ClipboardProtocolHelperCore[0m
[36m2020-03-11 16:07:35,070 client   1 @55.717 process clipboard request, request_id=0, selection=PRIMARY, local name=CLIPBOARD, target=UTF8_STRING[0m
[36m2020-03-11 16:07:35,070 client   1 @55.717 OpenClipboard(0x2a0b82)=1[0m
[36m2020-03-11 16:07:35,071 client   1 @55.719 got 5 bytes of data: "b'text1'"[0m
[36m2020-03-11 16:07:35,071 client   1 @55.719 got_text('text1')[0m
[36m2020-03-11 16:07:35,071 client   1 @55.719 proxy_got_contents(0, PRIMARY, UTF8_STRING, UTF8_STRING, 8, <class 'bytes'>:5) data=0x7465787431..[0m
[36m2020-03-11 16:07:35,071 client   1 @55.720 perform clipboard limit checking - datasize - 5, -1[0m
[36m2020-03-11 16:07:35,071 client   1 @55.720 _munge_raw_selection_to_wire('UTF8_STRING', 'UTF8_STRING', 8, "'text1'")[0m
[36m2020-03-11 16:07:35,072 client   1 @55.720 _do_munge_raw_selection_to_wire(UTF8_STRING, UTF8_STRING, 8, <class 'bytes'>:5)[0m
[36m2020-03-11 16:07:35,072 client   1 @55.720 clipboard raw -> wire: ('UTF8_STRING', 8, '"b\'text1\'"') -> '"(b\'bytes\', b\'text1\')"'[0m
[36m2020-03-11 16:07:35,072 client   1 @55.721 clipboard_send: clipboard-contents[0m
[36m2020-03-11 16:07:35,073 client   1 @55.721 process_clipboard_packet: clipboard-pending-requests, helper=ClipboardProtocolHelperCore[0m
[36m2020-03-11 16:07:35,073 process clipboard contents, selection=PRIMARY, type=UTF8_STRING, format=8[0m
[36m2020-03-11 16:07:35,073 client   1 @55.721 clipboard_progress(None, 1)[0m
[36m2020-03-11 16:07:35,073 wire selection to raw, encoding=bytes, type=UTF8_STRING, format=8, len(data)=5[0m
[36m2020-03-11 16:07:35,073 client   1 @55.721 clipboard_notify(1) notification timer=None[0m
[36m2020-03-11 16:07:35,074 clipboard wire -> raw: ('UTF8_STRING', 8, 'bytes', "'text1'") -> 'text1'[0m
[36m2020-03-11 16:07:35,074 clipboard got contents(0, 'UTF8_STRING', 8, "'text1'"): proxy=X11ClipboardProxy(PRIMARY) for selection=PRIMARY[0m
[36m2020-03-11 16:07:35,074 got_contents('UTF8_STRING', 'UTF8_STRING', 8, "'text1'") pending=(<gtk.gdk.Window object at 0x7f549e6f0780 (GdkWindow at 0x1afbea0)>, u'_XT_SELECTION_0', 478058776)[0m
[36m2020-03-11 16:07:35,075 setting response 'text1' to property _XT_SELECTION_0 of window child of 'xterm' as UTF8_STRING[0m
[36m2020-03-11 16:07:35,075 set_selection_response(<gtk.gdk.Window object at 0x7f549e6f0780 (GdkWindow at 0x1afbea0)>, UTF8_STRING, _XT_SELECTION_0, UTF8_STRING, 8, "'text1'", 478058776)[0m
[36m2020-03-11 16:07:35,175 sending clipboard-pending-requests=0 to ClientConnection(1 : Protocol(unix-domain socket:/run/user/2129/xpra/redacted-1338))[0m
[36m2020-03-11 16:07:35,180 client   1 @55.832 process_clipboard_packet: clipboard-pending-requests, helper=ClipboardProtocolHelperCore[0m
[36m2020-03-11 16:07:35,181 client   1 @55.833 clipboard_progress(None, 0)[0m
[36m2020-03-11 16:07:35,182 client   1 @55.833 clipboard_notify(0) notification timer=None[0m
[36m2020-03-11 16:07:42,465 do_xpra_selection_clear(<X11:SelectionClear {'delivered_to': '0x40001e', 'send_event': '0', 'selection': 'PRIMARY', 'window': '0x40001e', 'time': '478066184', 'serial': '0xb1a'}>)[0m
[36m2020-03-11 16:07:42,466 do_xpra_selection_clear(<X11:SelectionClear {'delivered_to': '0x40001e', 'send_event': '0', 'selection': 'PRIMARY', 'window': '0x40001e', 'time': '478066184', 'serial': '0xb1a'}>) was owned=True[0m
[36m2020-03-11 16:07:42,466 do_owner_changed()[0m
[36m2020-03-11 16:07:42,466 do_xpra_xfixes_selection_notify_event(<X11:XFSelectionNotify {'delivered_to': '0x40001e', 'send_event': '0', 'selection': 'PRIMARY', 'timestamp': '478066184', 'owner': '0x600026', 'subtype': '0', 'window': '0x40001e', 'selection_timestamp': '478066184', 'serial': '0xb1a'}>)[0m
[36m2020-03-11 16:07:42,466 do_selection_notify_event(<X11:XFSelectionNotify {'delivered_to': '0x40001e', 'send_event': '0', 'selection': 'PRIMARY', 'timestamp': '478066184', 'owner': '0x600026', 'subtype': '0', 'window': '0x40001e', 'selection_timestamp': '478066184', 'serial': '0xb1a'}>) owned=False, was False, enabled=True, can-send=True[0m
[36m2020-03-11 16:07:42,467 get_contents(TARGETS, <function got_targets at 0x7f549e6f25f0>, 0) owned=False, have-token=False[0m
[36m2020-03-11 16:07:42,467 requesting local XConvertSelection from child of 'xterm' as 'TARGETS' into 'PRIMARY-TARGETS'[0m
[36m2020-03-11 16:07:42,469 do_xpra_property_notify_event(<X11:PropertyNotify {'delivered_to': '0x40001e', 'send_event': '0', 'time': '478066188', 'window': '0x40001e', 'atom': 'PRIMARY-TARGETS', 'serial': '0xb30'}>)[0m
[36m2020-03-11 16:07:42,469 do_property_notify(<X11:PropertyNotify {'delivered_to': '0x40001e', 'send_event': '0', 'time': '478066188', 'window': '0x40001e', 'atom': 'PRIMARY-TARGETS', 'serial': '0xb30'}>)[0m
[36m2020-03-11 16:07:42,469 PRIMARY-TARGETS='\xe7\x00\x00\x00\x00\x00\x00\x00{\x01\x00\x00\x .. x00\x00\x00\x00\x88\x01\x00\x00\x00\x00\x00\x00' (ATOM : 32)[0m
[36m2020-03-11 16:07:42,470 filter_data(TARGETS, ATOM, 32, ..)[0m
[36m2020-03-11 16:07:42,471 got_local_contents: calling <function got_targets at 0x7f549e6f25f0>('ATOM', 32, "'\\xe7\\x00\\x00\\x00\\x00\\x00\\x00\\x00{\\x01\\x00\\x00\\x .. x00\\x00\\x00\\x00\\x88\\x01\\x00\\x00\\x00\\x00\\x00\\x00'"), time=0[0m
[36m2020-03-11 16:07:42,471 got_targets: ('UTF8_STRING', 'TEXT', 'COMPOUND_TEXT', 'STRING', 'LENGTH', 'LIST_LENGTH', 'TIMESTAMP', 'HOSTNAME', 'IP_ADDRESS', 'USER', 'CLASS', 'NAME', 'CLIENT_WINDOW', 'OWNER_OS')[0m
[36m2020-03-11 16:07:42,471 get_contents(UTF8_STRING, <function got_text_target at 0x7f54acc16500>, 0) owned=False, have-token=False[0m
[36m2020-03-11 16:07:42,472 requesting local XConvertSelection from child of 'xterm' as 'UTF8_STRING' into 'PRIMARY-UTF8_STRING'[0m
[36m2020-03-11 16:07:42,473 do_xpra_property_notify_event(<X11:PropertyNotify {'delivered_to': '0x40001e', 'send_event': '0', 'time': '478066189', 'window': '0x40001e', 'atom': 'PRIMARY-TARGETS', 'serial': '0xb35'}>)[0m
[36m2020-03-11 16:07:42,473 do_property_notify(<X11:PropertyNotify {'delivered_to': '0x40001e', 'send_event': '0', 'time': '478066189', 'window': '0x40001e', 'atom': 'PRIMARY-TARGETS', 'serial': '0xb35'}>)[0m
[36m2020-03-11 16:07:42,474 do_property_notify() property 'PRIMARY-TARGETS' is gone?
Traceback (most recent call last):
  File "/usr/lib64/python2.7/site-packages/xpra/x11/gtk_x11/clipboard.py", line 601, in do_property_notify
    dtype, dformat = X11Window.GetWindowPropertyType(self.xid, event.atom, True)
  File "xpra/x11/bindings/window_bindings.pyx", line 1173, in xpra.x11.bindings.window_bindings.X11WindowBindingsInstance.GetWindowPropertyType
BadPropertyType: None type[0m
[36m2020-03-11 16:07:42,475 do_xpra_property_notify_event(<X11:PropertyNotify {'delivered_to': '0x40001e', 'send_event': '0', 'time': '478066192', 'window': '0x40001e', 'atom': 'PRIMARY-UTF8_STRING', 'serial': '0xb58'}>)[0m
[36m2020-03-11 16:07:42,475 do_property_notify(<X11:PropertyNotify {'delivered_to': '0x40001e', 'send_event': '0', 'time': '478066192', 'window': '0x40001e', 'atom': 'PRIMARY-UTF8_STRING', 'serial': '0xb58'}>)[0m
[36m2020-03-11 16:07:42,476 PRIMARY-UTF8_STRING='text2' (UTF8_STRING : 8)[0m
[36m2020-03-11 16:07:42,476 filter_data(UTF8_STRING, UTF8_STRING, 8, ..)[0m
[36m2020-03-11 16:07:42,476 got_local_contents: calling <function got_text_target at 0x7f54acc16500>('UTF8_STRING', 8, "'text2'"), time=0[0m
[36m2020-03-11 16:07:42,476 got_text_target(UTF8_STRING, 8, 'text2')[0m
[36m2020-03-11 16:07:42,476 _send_clipboard_token_handler(X11ClipboardProxy(PRIMARY), "(('UTF8_STRING', 'TEXT', 'STRING'), ('UTF8_STRING', 'UTF8_STRING', 8, 'text2'))")[0m
[36m2020-03-11 16:07:42,476 _munge_raw_selection_to_wire('UTF8_STRING', 'UTF8_STRING', 8, "'text2'")[0m
[36m2020-03-11 16:07:42,477 _do_munge_raw_selection_to_wire(UTF8_STRING, UTF8_STRING, 8, <type 'str'>:5)[0m
[36m2020-03-11 16:07:42,477 do_xpra_property_notify_event(<X11:PropertyNotify {'delivered_to': '0x40001e', 'send_event': '0', 'time': '478066195', 'window': '0x40001e', 'atom': 'PRIMARY-UTF8_STRING', 'serial': '0xb62'}>)[0m
[36m2020-03-11 16:07:42,477 do_property_notify(<X11:PropertyNotify {'delivered_to': '0x40001e', 'send_event': '0', 'time': '478066195', 'window': '0x40001e', 'atom': 'PRIMARY-UTF8_STRING', 'serial': '0xb62'}>)[0m
[36m2020-03-11 16:07:42,478 do_property_notify() property 'PRIMARY-UTF8_STRING' is gone?
Traceback (most recent call last):
  File "/usr/lib64/python2.7/site-packages/xpra/x11/gtk_x11/clipboard.py", line 601, in do_property_notify
    dtype, dformat = X11Window.GetWindowPropertyType(self.xid, event.atom, True)
  File "xpra/x11/bindings/window_bindings.pyx", line 1173, in xpra.x11.bindings.window_bindings.X11WindowBindingsInstance.GetWindowPropertyType
BadPropertyType: None type[0m
[36m2020-03-11 16:07:42,483 client   1 @03.135 process_clipboard_packet: clipboard-token, helper=ClipboardProtocolHelperCore[0m
[36m2020-03-11 16:07:42,489 client   1 @03.136 process clipboard token selection=PRIMARY, local clipboard name=CLIPBOARD, proxy=Win32ClipboardProxy[0m
[36m2020-03-11 16:07:42,489 client   1 @03.137 wire selection to raw, encoding=bytes, type=UTF8_STRING, format=8, len(data)=5[0m
[36m2020-03-11 16:07:42,490 client   1 @03.137 got token, selection=CLIPBOARD, targets=(b'UTF8_STRING', b'TEXT', b'STRING'), target data={'UTF8_STRING': ('UTF8_STRING', 8, b'text2')}, claim=True, can-receive=True[0m
[36m2020-03-11 16:07:42,490 client   1 @03.138 _filter_targets((b'UTF8_STRING', b'TEXT', b'STRING'))=('UTF8_STRING', 'TEXT', 'STRING')[0m
[36m2020-03-11 16:07:42,491 client   1 @03.138 _filter_targets((b'UTF8_STRING', b'TEXT', b'STRING'))=('UTF8_STRING', 'TEXT', 'STRING')[0m
[36m2020-03-11 16:07:42,491 client   1 @03.139 got_contents: tell OS we have UTF8_STRING, TEXT, STRING[0m
[36m2020-03-11 16:07:42,491 client   1 @03.139 we got a byte string: b'text2'[0m
[36m2020-03-11 16:07:42,491 client   1 @03.140 set_clipboard_text(b'text2', 5)[0m
[36m2020-03-11 16:07:42,491 client   1 @03.140 MultiByteToWideChar wlen=5[0m
[36m2020-03-11 16:07:42,491 client   1 @03.141 GlobalAlloc buf=0x23e70078[0m
[36m2020-03-11 16:07:42,492 client   1 @03.141 OpenClipboard(0x2a0b82)=1[0m
[36m2020-03-11 16:07:42,492 client   1 @03.141 SetClipboardData(..) done[0m
[36m2020-03-11 16:07:42,492 client   1 @03.143 clipboard event: CLIPBOARDUPDATE[0m
2020-03-11 16:07:42,492 client   1 @03.144 unknown string message: 0xc188 / 0x52 / 0x1200[0m
2020-03-11 16:07:42,493 client   1 @03.145 unknown string message: 0xc188 / 0x50 / 0x0[0m
[36m2020-03-11 16:07:42,493 client   1 @03.145 remove_block: CLIPBOARD[0m
[36m2020-03-11 16:08:07,661 client   1 @28.312 clipboard event: DESTROYCLIPBOARD[0m
[36m2020-03-11 16:08:07,662 client   1 @28.313 clipboard event: CLIPBOARDUPDATE[0m
2020-03-11 16:08:07,664 client   1 @28.316 unknown string message: 0xc188 / 0x52 / 0x1201[0m
2020-03-11 16:08:07,666 client   1 @28.317 unknown string message: 0xc188 / 0x50 / 0x0[0m
[36m2020-03-11 16:08:07,666 client   1 @28.318 _send_clipboard_token_handler(Win32ClipboardProxy, '()')[0m
[36m2020-03-11 16:08:07,668 client   1 @28.318 clipboard_send: clipboard-token[0m
[36m2020-03-11 16:08:07,668 client   1 @28.319 remove_block: CLIPBOARD[0m
[36m2020-03-11 16:08:07,669 process clipboard token selection=CLIPBOARD, local clipboard name=CLIPBOARD, proxy=X11ClipboardProxy(CLIPBOARD)[0m
[36m2020-03-11 16:08:07,669 got token, selection=CLIPBOARD, targets=None, target data=None, claim=True, can-receive=True[0m
[36m2020-03-11 16:08:07,669 claim_selection: set selection owner returned 1, owner=0x40001e[0m
[36m2020-03-11 16:08:07,670 claim_selection: sending message to root window[0m
[36m2020-03-11 16:08:07,670 claim_selection: done, owned=True[0m
[36m2020-03-11 16:08:07,670 do_xpra_xfixes_selection_notify_event(<X11:XFSelectionNotify {'delivered_to': '0x40001e', 'send_event': '0', 'selection': 'CLIPBOARD', 'timestamp': '478091389', 'owner': '0x40001e', 'subtype': '0', 'window': '0x40001e', 'selection_timestamp': '478091389', 'serial': '0xdaa'}>)[0m
[36m2020-03-11 16:08:07,671 do_selection_notify_event(<X11:XFSelectionNotify {'delivered_to': '0x40001e', 'send_event': '0', 'selection': 'CLIPBOARD', 'timestamp': '478091389', 'owner': '0x40001e', 'subtype': '0', 'window': '0x40001e', 'selection_timestamp': '478091389', 'serial': '0xdaa'}>) owned=True, was True, enabled=True, can-send=True[0m
[36m2020-03-11 16:08:27,297 client   1 @47.948 clipboard event: CLIPBOARDUPDATE[0m
[36m2020-03-11 16:08:27,299 client   1 @47.948 schedule_emit_token() elapsed=19630 (max=100)[0m
[36m2020-03-11 16:08:27,299 client   1 @47.949 _send_clipboard_token_handler(Win32ClipboardProxy, '()')[0m
[36m2020-03-11 16:08:27,299 client   1 @47.949 clipboard_send: clipboard-token[0m
[36m2020-03-11 16:08:27,299 process clipboard token selection=CLIPBOARD, local clipboard name=CLIPBOARD, proxy=X11ClipboardProxy(CLIPBOARD)[0m
[36m2020-03-11 16:08:27,300 got token, selection=CLIPBOARD, targets=None, target data=None, claim=True, can-receive=True[0m
[36m2020-03-11 16:08:27,300 claim_selection: set selection owner returned 1, owner=0x40001e[0m
[36m2020-03-11 16:08:27,300 claim_selection: sending message to root window[0m
[36m2020-03-11 16:08:27,300 claim_selection: done, owned=True[0m
[36m2020-03-11 16:08:27,301 do_xpra_xfixes_selection_notify_event(<X11:XFSelectionNotify {'delivered_to': '0x40001e', 'send_event': '0', 'selection': 'CLIPBOARD', 'timestamp': '478111020', 'owner': '0x40001e', 'subtype': '0', 'window': '0x40001e', 'selection_timestamp': '478111020', 'serial': '0xf1e'}>)[0m
[36m2020-03-11 16:08:27,302 do_selection_notify_event(<X11:XFSelectionNotify {'delivered_to': '0x40001e', 'send_event': '0', 'selection': 'CLIPBOARD', 'timestamp': '478111020', 'owner': '0x40001e', 'subtype': '0', 'window': '0x40001e', 'selection_timestamp': '478111020', 'serial': '0xf1e'}>) owned=True, was True, enabled=True, can-send=True[0m
2020-03-11 16:08:27,302 client   1 @47.951 unknown string message: 0xc188 / 0x52 / 0x1202[0m
2020-03-11 16:08:27,302 client   1 @47.952 unknown string message: 0xc188 / 0x50 / 0x0[0m
[36m2020-03-11 16:08:27,303 client   1 @47.953 remove_block: CLIPBOARD[0m

Client log:

2020-03-11 16:07:32,399 clipboard event: CLIPBOARDUPDATE
2020-03-11 16:07:32,399 schedule_emit_token() elapsed=694232205 (max=100)
2020-03-11 16:07:32,400 _send_clipboard_token_handler(Win32ClipboardProxy, '()')
2020-03-11 16:07:32,400 clipboard_send: clipboard-token
2020-03-11 16:07:32,402 unknown string message: 0xc188 / 0x52 / 0x11ff
2020-03-11 16:07:32,403 unknown string message: 0xc188 / 0x50 / 0x0
2020-03-11 16:07:32,403 remove_block: CLIPBOARD
2020-03-11 16:07:34,481 process_clipboard_packet: clipboard-request, helper=ClipboardProtocolHelperCore
2020-03-11 16:07:34,482 process clipboard request, request_id=0, selection=PRIMARY, local name=CLIPBOARD, target=UTF8_STRING
2020-03-11 16:07:34,483 OpenClipboard(0x2a0b82)=1
2020-03-11 16:07:34,484 got 5 bytes of data: "b'text1'"
2020-03-11 16:07:34,484 got_text('text1')
2020-03-11 16:07:34,485 proxy_got_contents(0, PRIMARY, UTF8_STRING, UTF8_STRING, 8, <class 'bytes'>:5) data=0x7465787431..
2020-03-11 16:07:34,485 perform clipboard limit checking - datasize - 5, -1
2020-03-11 16:07:34,485 _munge_raw_selection_to_wire('UTF8_STRING', 'UTF8_STRING', 8, "'text1'")
2020-03-11 16:07:34,486 _do_munge_raw_selection_to_wire(UTF8_STRING, UTF8_STRING, 8, <class 'bytes'>:5)
2020-03-11 16:07:34,486 clipboard raw -> wire: ('UTF8_STRING', 8, '"b\'text1\'"') -> '"(b\'bytes\', b\'text1\')"'
2020-03-11 16:07:34,486 clipboard_send: clipboard-contents
2020-03-11 16:07:34,486 process_clipboard_packet: clipboard-pending-requests, helper=ClipboardProtocolHelperCore
2020-03-11 16:07:34,487 clipboard_progress(None, 1)
2020-03-11 16:07:34,487 clipboard_notify(1) notification timer=None
2020-03-11 16:07:34,598 process_clipboard_packet: clipboard-pending-requests, helper=ClipboardProtocolHelperCore
2020-03-11 16:07:34,598 clipboard_progress(None, 0)
2020-03-11 16:07:34,599 clipboard_notify(0) notification timer=None
2020-03-11 16:07:36,189 UI thread is now blocked
2020-03-11 16:07:36,506 UI thread is running again, resuming
2020-03-11 16:07:41,900 process_clipboard_packet: clipboard-token, helper=ClipboardProtocolHelperCore
2020-03-11 16:07:41,901 process clipboard token selection=PRIMARY, local clipboard name=CLIPBOARD, proxy=Win32ClipboardProxy
2020-03-11 16:07:41,902 wire selection to raw, encoding=bytes, type=UTF8_STRING, format=8, len(data)=5
2020-03-11 16:07:41,902 got token, selection=CLIPBOARD, targets=(b'UTF8_STRING', b'TEXT', b'STRING'), target data={'UTF8_STRING': ('UTF8_STRING', 8, b'text2')}, claim=True, can-receive=True
2020-03-11 16:07:41,903 _filter_targets((b'UTF8_STRING', b'TEXT', b'STRING'))=('UTF8_STRING', 'TEXT', 'STRING')
2020-03-11 16:07:41,904 _filter_targets((b'UTF8_STRING', b'TEXT', b'STRING'))=('UTF8_STRING', 'TEXT', 'STRING')
2020-03-11 16:07:41,904 got_contents: tell OS we have UTF8_STRING, TEXT, STRING
2020-03-11 16:07:41,904 we got a byte string: b'text2'
2020-03-11 16:07:41,905 set_clipboard_text(b'text2', 5)
2020-03-11 16:07:41,905 MultiByteToWideChar wlen=5
2020-03-11 16:07:41,906 GlobalAlloc buf=0x23e70078
2020-03-11 16:07:41,906 OpenClipboard(0x2a0b82)=1
2020-03-11 16:07:41,906 SetClipboardData(..) done
2020-03-11 16:07:41,908 clipboard event: CLIPBOARDUPDATE
2020-03-11 16:07:41,909 unknown string message: 0xc188 / 0x52 / 0x1200
2020-03-11 16:07:41,910 unknown string message: 0xc188 / 0x50 / 0x0
2020-03-11 16:07:41,910 remove_block: CLIPBOARD
2020-03-11 16:08:07,076 clipboard event: DESTROYCLIPBOARD
2020-03-11 16:08:07,077 clipboard event: CLIPBOARDUPDATE
2020-03-11 16:08:07,080 unknown string message: 0xc188 / 0x52 / 0x1201
2020-03-11 16:08:07,081 unknown string message: 0xc188 / 0x50 / 0x0
2020-03-11 16:08:07,082 _send_clipboard_token_handler(Win32ClipboardProxy, '()')
2020-03-11 16:08:07,082 clipboard_send: clipboard-token
2020-03-11 16:08:07,082 remove_block: CLIPBOARD
2020-03-11 16:08:26,711 clipboard event: CLIPBOARDUPDATE
2020-03-11 16:08:26,711 schedule_emit_token() elapsed=19630 (max=100)
2020-03-11 16:08:26,712 _send_clipboard_token_handler(Win32ClipboardProxy, '()')
2020-03-11 16:08:26,712 clipboard_send: clipboard-token
2020-03-11 16:08:26,714 unknown string message: 0xc188 / 0x52 / 0x1202
2020-03-11 16:08:26,715 unknown string message: 0xc188 / 0x50 / 0x0
2020-03-11 16:08:26,716 remove_block: CLIPBOARD


Thu, 12 Mar 2020 14:13:17 GMT - Antoine Martin: status changed

I'll take a look later, but the bug may not be where you expect it: highlighting text in an xterm does not copy it to the clipboard, only the primary selection, and that should not be synchronized with mswindows clients, as those only have one clipboard. So if anything, we're synchronizing too much, not too little.


Thu, 12 Mar 2020 14:20:44 GMT - pm54389:

Thanks Antoine.

Due to the remote-clipboard=PRIMARY setting on the client, I believe the Linux primary selection should be being synchronised with the Windows clipboard. This is what happens with the v2.4.2 client.


Fri, 20 Mar 2020 02:20:34 GMT - Antoine Martin: status changed; resolution set

Due to the remote-clipboard=PRIMARY setting on the client, I believe the Linux primary selection should be being synchronised with the Windows clipboard.

DOH. Sorry I had missed that bit of info!

Fixed in r25696.

You can find builds here with this fix: https://xpra.org/beta/windows/ (RC builds for both 4.0 and 3.0.8)


Sat, 21 Mar 2020 00:18:51 GMT - pm54389:

Thanks for this Antoine! I've tested with the RC client and this is now working.

I've now noticed another regression from v2.4.2. It seems to no longer be doing line-ending conversions. For example:

Let me know if you'd like more info...


Sat, 21 Mar 2020 00:58:42 GMT - pm54389:

And another regression, sorry.

Copying between Windows and gvim no longer works. I tried debugging this with xpra clipboard-test and it's pretty strange. Copying between Windows and xpra clipboard-test works fine (in both directions, synchronising with both PRIMARY and CLIPBOARD), and also between xpra clipboard-test and gvim. But going directly from Windows to gvim doesn't work: gvim just says there's nothing in register */+ (i.e. nothing in PRIMARY/CLIPBOARD). In the other direction it kinda works, except that most times, gvim loses ownership of the selection buffer immediately. According to xpra clipboard-test the new owner has the same id as when I copy something in Notepad. This is with both the GTK3 and Motif versions of gvim.

Again, let me know if any more info would help...


Sat, 21 Mar 2020 08:18:16 GMT - Antoine Martin: status changed; resolution deleted

I've now noticed another regression from v2.4.2. It seems to no longer be doing line-ending conversions.

That's fixed in r25704.

As for the problem with gvim: when something is copied onto the clipboard client side, we're notifying the server, which correctly claims the selection and sends the message about now owning it:

claim_selection: set selection owner returned 1, owner=0x400008
claim_selection: sending message to root window
claim_selection: done, owned=True
do_xpra_xfixes_selection_notify_event(<X11:XFSelectionNotify {'send_event': '0', 'serial': '0x9a80', 'delivered_to': '0x400008', 'window': '0x400008', 'subtype': '0', 'owner': '0x400008', 'selection': 'CLIPBOARD', 'timestamp': '217965632', 'selection_timestamp': '217965632'}>)
do_selection_notify_event(<X11:XFSelectionNotify {'send_event': '0', 'serial': '0x9a80', 'delivered_to': '0x400008', 'window': '0x400008', 'subtype': '0', 'owner': '0x400008', 'selection': 'CLIPBOARD', 'timestamp': '217965632', 'selection_timestamp': '217965632'}>) owned=True, was True, enabled=True, can-send=True

This works with all the other applications but not gvim!? It's as if gvim doesn't notice we own the selection, since it never asks us for the contents.


Sat, 21 Mar 2020 12:42:25 GMT - Antoine Martin: owner, status changed

Doing something similar with a Linux client (no need for --remote-clipboard=PRIMARY) works OK, though gvim is requesting some invalid targets (_VIMENC_TEXT, _VIM_TEXT).. naughty! r25711 will timeout those a bit quicker.

Xpra 4.0-RC client also works OK. Only 3.0.8 is having problems.

That's because v3 is responding to the invalid target (ie: _VIMENC_TEXT) whereas 4.0 is discarding those. So r25712 backports the change that fixes that (see #2450).

@pm54389: please try the latest beta builds for either 3.0.8 or 4.0 - both should work!


Sun, 22 Mar 2020 00:27:34 GMT - pm54389: owner changed

Thanks again, Antoine. Copying from Windows to GTK3 gvim works now, and line endings are converted as expected. I tested both v3.0.8 and v4.0.

I'm seeing a few oddities, though I think I can live with them:

Thanks again for your time and effort on this.


Sun, 22 Mar 2020 03:46:24 GMT - Antoine Martin: status changed; resolution set

When highlighting a large block of text in gvim, it usually loses ownership of the selection buffer part way through. This issue only happens in v3.0.8, not v4.0. (I also saw this in v2.4.2 sometimes)

I'm not going to worry about this one. The clipboard code from v4 will be backported wholesale to the v3.1.x branch when it replaces the v3.0.x branch. (ETA reasonably soon after the v4 release)

copying from Windows to a Motif build of gvim (v8.2.346) still doesn't work. This is in both v3.0.8 and v4.0 and with clipboard sync set to both PRIMARY and CLIPBOARD. (I don't believe this actually worked in v2.4.2 either.) Copying from xpra clipboard-test to Motif gvim does work.

I don't have a Motif build at hand. We should try to fix this. Can you please create a new ticket for this? (preferably with instructions on how to get a Motif build of gvim - simply if possible)

although the client Xpra.conf contains remote-clipboard=PRIMARY, clicking [tray icon -> clipboard -> selection] shows CLIPBOARD selected (but it does seem to actually be using PRIMARY). This is in both v3.0.8 and v4.0.

Ah, I didn't think of checking that. (it's been broken for a while..) Fixed in r25720.


Mon, 23 Mar 2020 07:31:31 GMT - stdedos:

Maybe that's related to this one?

Traceback (most recent call last):
  File "_ctypes/callbacks.c", line 237, in 'calling callback function'
  File "E:\Xpra\trunk\src/xpra/platform/win32/clipboard.py", line 137, in wnd_proc
  File "E:\Xpra\trunk\src/xpra/platform/win32/clipboard.py", line 90, in get_owner_info
TypeError: not enough arguments for format string

Mon, 23 Mar 2020 07:56:25 GMT - Antoine Martin:

Maybe that's related to this one?

Could be.

Traceback .. in get_owner_info

Fixed in r25735.

New beta build posted.


Mon, 23 Mar 2020 23:17:57 GMT - pm54389:

Thanks so much, guys.

Can you please create a new ticket for this? (preferably with instructions on how to get a Motif build of gvim - simply if possible)

I'm still seeing the issue in the latest beta, so I've raised #2673


Sat, 23 Jan 2021 05:56:43 GMT - migration script:

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