Xpra: Ticket #2450: eclipse does not paste

As reported on the mailing list: Clipboard paste in Eclipse. Reproducible with win7 client and Fedora 30 server. I saw a similar problem earlier with a Fedora 30 client, but can't reproduce it.

Here's the debug log.



Fri, 18 Oct 2019 10:47:47 GMT - Antoine Martin: priority, status, description changed


Mon, 21 Oct 2019 06:48:32 GMT - Antoine Martin:

See also #2452, the new clipboard code comes from #812


Mon, 21 Oct 2019 10:35:35 GMT - Antoine Martin:

I think the problem comes from the fact that an application is free to request any target it wants (ie: from above, target=UTF8_STRING), but the win32 client is limited to just text/plain and the application may not be happy with that.. We should "convert" (or just cast) it.


Mon, 21 Oct 2019 11:06:44 GMT - Antoine Martin:

Comparing this with a native X11 client which does reply with the exact target requested:

do_xpra_selection_request(<X11:SelectionRequest {'send_event': '0', 'serial': '0x335e', 'delivered_to': '0x400008', 'window': '0x400008', 'requestor': '0xc06c77', 'selection': 'CLIPBOARD', 'target': 'UTF8_STRING', 'property': 'GDK_SELECTION', 'time': '363040869'}>)
do_selection_request_event(<X11:SelectionRequest {'send_event': '0', 'serial': '0x335e', 'delivered_to': '0x400008', 'window': '0x400008', 'requestor': '0xc06c77', 'selection': 'CLIPBOARD', 'target': 'UTF8_STRING', 'property': 'GDK_SELECTION', 'time': '363040869'}>)
clipboard request for CLIPBOARD from window 0xc06c77: 'Eclipse', target=UTF8_STRING, prop=GDK_SELECTION
send_clipboard_request_handler(X11ClipboardProxy(CLIPBOARD), 'CLIPBOARD', 'UTF8_STRING')
send_clipboard_request id=0
sending clipboard-pending-requests=1 to ClientConnection(2 : Protocol(unix-domain socket:/run/user/1000/xpra/localhost.localdomain-4))
client   2 @55.878 process_clipboard_packet: clipboard-request, helper=X11Clipboard
client   2 @55.878 process clipboard request, request_id=0, selection=CLIPBOARD, local name=CLIPBOARD, target=UTF8_STRING
client   2 @55.878 get_contents(UTF8_STRING, <function ClipboardProtocolHelperCore._process_clipboard_request.<locals>.got_contents at 0x7f4912fc2680>, 0) owned=False, have-token=False
client   2 @55.878 requesting local XConvertSelection from 'Terminal' as 'UTF8_STRING' into 'CLIPBOARD-UTF8_STRING'
client   2 @55.879 process_clipboard_packet: clipboard-pending-requests, helper=X11Clipboard
client   2 @55.879 clipboard_progress(None, 1)
client   2 @55.879 clipboard_notify(1) notification timer=None
client   2 @55.880 do_xpra_property_notify_event(<X11:PropertyNotify {'send_event': '0', 'serial': '0x23ca', 'delivered_to': '0x4800015', 'window': '0x4800015', 'atom': 'CLIPBOARD-UTF8_STRING', 'time': '363040876'}>)
client   2 @55.880 do_property_notify(<X11:PropertyNotify {'send_event': '0', 'serial': '0x23ca', 'delivered_to': '0x4800015', 'window': '0x4800015', 'atom': 'CLIPBOARD-UTF8_STRING', 'time': '363040876'}>)
client   2 @55.880 CLIPBOARD-UTF8_STRING='MYVALUE' (UTF8_STRING : 8)
client   2 @55.880 filter_data(UTF8_STRING, UTF8_STRING, 8, ..)
client   2 @55.880 got_local_contents: calling <function ClipboardProtocolHelperCore._process_clipboard_request.<locals>.got_contents at 0x7f4912fc2680>('UTF8_STRING', 8, '"b\'MYVALUE\'"'), time=0
client   2 @55.880 proxy_got_contents(0, CLIPBOARD, UTF8_STRING, UTF8_STRING, 8, <class 'bytes'>:7) data=0x4d5956414c5545..
client   2 @55.880 perform clipboard limit checking - datasize - 7, -1
client   2 @55.881 _munge_raw_selection_to_wire('UTF8_STRING', 'UTF8_STRING', 8, "'MYVALUE'")
client   2 @55.881 _do_munge_raw_selection_to_wire(UTF8_STRING, UTF8_STRING, 8, <class 'bytes'>:7)
client   2 @55.881 clipboard raw -> wire: ('UTF8_STRING', 8, '"b\'MYVALUE\'"') -> '"(b\'bytes\', b\'MYVALUE\')"'
client   2 @55.881 clipboard_send: clipboard-contents
process clipboard contents, selection=CLIPBOARD, type=UTF8_STRING, format=8
wire selection to raw, encoding=bytes, type=UTF8_STRING, format=8, len(data)=7
clipboard wire -> raw: ('UTF8_STRING', 8, 'bytes', '"b\'MYVALUE\'"') -> "b'MYVALUE'"
client   2 @55.881 do_xpra_property_notify_event(<X11:PropertyNotify {'send_event': '0', 'serial': '0x23d1', 'delivered_to': '0x4800015', 'window': '0x4800015', 'atom': 'CLIPBOARD-UTF8_STRING', 'time': '363040877'}>)
clipboard got contents(0, 'UTF8_STRING', 8, '"b\'MYVALUE\'"'): proxy=X11ClipboardProxy(CLIPBOARD) for selection=CLIPBOARD
got_contents('UTF8_STRING', 'UTF8_STRING', 8, '"b\'MYVALUE\'"') pending=(<GdkX11.X11Window object at 0x7f8731f9a780 (GdkX11Window at 0x55c89d2e0120)>, 'GDK_SELECTION', 363040869)
client   2 @55.881 do_property_notify(<X11:PropertyNotify {'send_event': '0', 'serial': '0x23d1', 'delivered_to': '0x4800015', 'window': '0x4800015', 'atom': 'CLIPBOARD-UTF8_STRING', 'time': '363040877'}>)
setting response 'MYVALUE' to property GDK_SELECTION of window 'Eclipse' as UTF8_STRING
client   2 @55.882 do_property_notify() property 'CLIPBOARD-UTF8_STRING' is gone?
set_selection_response(<GdkX11.X11Window object at 0x7f8731f9a780 (GdkX11Window at 0x55c89d2e0120)>, UTF8_STRING, GDK_SELECTION, UTF8_STRING, 8, "'MYVALUE'", 363040869)
client   2 @55.882   File "/usr/lib64/python3.7/site-packages/xpra/x11/gtk_x11/clipboard.py", line 574, in do_property_notify
client   2 @55.882     dtype, dformat = X11Window.GetWindowPropertyType(self.xid, event.atom, True)
client   2 @55.882   File "xpra/x11/bindings/window_bindings.pyx", line 1171, in xpra.x11.bindings.window_bindings.X11WindowBindingsInstance.GetWindowPropertyType
client   2 @55.882     raise BadPropertyType("None type")
client   2 @55.882 BadPropertyType: None type
sending clipboard-pending-requests=0 to ClientConnection(2 : Protocol(unix-domain socket:/run/user/1000/xpra/localhost.localdomain-4))
client   2 @55.982 process_clipboard_packet: clipboard-pending-requests, helper=X11Clipboard
client   2 @55.982 clipboard_progress(None, 0)
client   2 @55.982 clipboard_notify(0) notification timer=None

Mon, 21 Oct 2019 11:38:32 GMT - Antoine Martin:

Probably fixed in r24231. Will test some more.


Tue, 22 Oct 2019 08:31:24 GMT - Antoine Martin: status changed; resolution set


Wed, 23 Oct 2019 11:34:06 GMT - Antoine Martin: status changed; resolution deleted

Looks like this fix is causing a regression: #2461.


Wed, 23 Oct 2019 12:21:06 GMT - Antoine Martin: status changed; resolution set

The correct fix is in r24247.


Sat, 21 Mar 2020 12:42:46 GMT - Antoine Martin:

Backported to v3 in r25712, see ticket/2638#comment:7.


Sat, 23 Jan 2021 05:51:36 GMT - migration script:

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