xpra icon
Bug tracker and wiki

Opened 5 weeks ago

Closed 4 weeks ago

#2450 closed defect (fixed)

eclipse does not paste

Reported by: Antoine Martin Owned by: Antoine Martin
Priority: critical Milestone: 4.0
Component: clipboard Version: 3.0.x
Keywords: Cc:

Description (last modified by Antoine Martin)

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.

  • Copy:
    client   4 @00.867 clipboard event: CLIPBOARDUPDATE
    client   4 @00.867 schedule_emit_token() elapsed=17919 (max=100)
    process clipboard token selection=CLIPBOARD, local clipboard name=CLIPBOARD, proxy=X11ClipboardProxy(CLIPBOARD)
    got token, selection=CLIPBOARD, targets=None, target data=None, claim=True, can-receive=True
    claim_selection: set selection owner returned 1, owner=0x40000d
    claim_selection: sending message to root window
    claim_selection: done, owned=True
    client   4 @00.868 _send_clipboard_token_handler(Win32ClipboardProxy, '()')
    client   4 @00.868 clipboard_send: clipboard-token
    client   4 @00.869 remove_block: CLIPBOARD
    do_xpra_xfixes_selection_notify_event(<X11:XFSelectionNotify {'send_event': '0', 'serial': '0xf1f4', 'delivered_to': '0x40000d', 'window': '0x40000d', 'subtype': '0', 'owner': '0x40000d', 'selection': 'CLIPBOARD', 'timestamp': '213693543', 'selection_timestamp': '213693543'}>)
    do_selection_notify_event(<X11:XFSelectionNotify {'send_event': '0', 'serial': '0xf1f4', 'delivered_to': '0x40000d', 'window': '0x40000d', 'subtype': '0', 'owner': '0x40000d', 'selection': 'CLIPBOARD', 'timestamp': '213693543', 'selection_timestamp': '213693543'}>) owned=True, was True (owner=0x40000d, xid=0x40000d), enabled=True, can-send=True
    
  • Paste into eclipse:
    do_xpra_selection_request(<X11:SelectionRequest {'send_event': '0', 'serial': '0xf676', 'delivered_to': '0x40000d', 'window': '0x40000d', 'requestor': '0xc01045', 'selection': 'CLIPBOARD', 'target': 'UTF8_STRING', 'property': 'GDK_SELECTION', 'time': '213702106'}>)
    do_selection_request_event(<X11:SelectionRequest {'send_event': '0', 'serial': '0xf676', 'delivered_to': '0x40000d', 'window': '0x40000d', 'requestor': '0xc01045', 'selection': 'CLIPBOARD', 'target': 'UTF8_STRING', 'property': 'GDK_SELECTION', 'time': '213702106'}>)
    clipboard request for CLIPBOARD from window 0xc01045: 'Eclipse', target=UTF8_STRING, prop=GDK_SELECTION
    send_clipboard_request_handler(X11ClipboardProxy(CLIPBOARD), 'CLIPBOARD', 'UTF8_STRING')
    send_clipboard_request id=2
    sending clipboard-pending-requests=1 to ClientConnection(4 : Protocol(tcp socket: 192.168.1.10:10000 <- 192.168.1.18:50350))
    client   4 @09.438 process_clipboard_packet: clipboard-request, helper=ClipboardProtocolHelperCore
    client   4 @09.439 process clipboard request, request_id=2, selection=CLIPBOARD, local name=CLIPBOARD, target=UTF8_STRING
    client   4 @09.439 OpenClipboard(0x1f0410)=1
    client   4 @09.439 got 22 bytes of data: "b'ALL_CSC_MODULE_OPTIONS'"
    client   4 @09.440 got_text('ALL_CSC_MODULE_OPTIONS')
    process clipboard contents, selection=CLIPBOARD, type=text/plain, format=8
    client   4 @09.440 proxy_got_contents(2, CLIPBOARD, UTF8_STRING, text/plain, 8, <class 'bytes'>:22) data=0x414c4c5f4353435f4d4f44554c455f4f5054494f4e53..
    wire selection to raw, encoding=bytes, type=text/plain, format=8, len(data)=22
    clipboard wire -> raw: ('text/plain', 8, 'bytes', '"b\'ALL_CSC_MODULE_OPTIONS\'"') -> "b'ALL_CSC_MODULE_OPTIONS'"
    clipboard got contents(2, 'text/plain', 8, '"b\'ALL_CSC_MODULE_OPTIONS\'"'): proxy=X11ClipboardProxy(CLIPBOARD) for selection=CLIPBOARD
    got_contents('UTF8_STRING', 'text/plain', 8, '"b\'ALL_CSC_MODULE_OPTIONS\'"') pending=(<GdkX11.X11Window object at 0x7f9dd87fc460 (GdkX11Window at 0x5652a2d286b0)>, 'GDK_SELECTION', 213702106)
    setting response 'ALL_CSC_MODULE_OPTIONS' to property GDK_SELECTION of window 'Eclipse' as text/plain
    set_selection_response(<GdkX11.X11Window object at 0x7f9dd87fc460 (GdkX11Window at 0x5652a2d286b0)>, UTF8_STRING, GDK_SELECTION, text/plain, 8, '"b\'ALL_CSC_MODULE_OPTIONS\'"', 213702106)
    client   4 @09.440 perform clipboard limit checking - datasize - 22, -1
    client   4 @09.440 _munge_raw_selection_to_wire('UTF8_STRING', 'text/plain', 8, "'ALL_CSC_MODULE_OPTIONS'")
    client   4 @09.440 _do_munge_raw_selection_to_wire(UTF8_STRING, text/plain, 8, <class 'bytes'>:22)
    client   4 @09.441 clipboard raw -> wire: ('text/plain', 8, '"b\'ALL_CSC_MODULE_OPTIONS\'"') -> '"(b\'bytes\', b\'ALL_CSC_MODULE_OPTIONS\')"'
    client   4 @09.441 clipboard_send: clipboard-contents
    client   4 @09.443 process_clipboard_packet: clipboard-pending-requests, helper=ClipboardProtocolHelperCore
    client   4 @09.443 clipboard_progress(None, 1)
    client   4 @09.443 clipboard_notify(1) notification timer=None
    sending clipboard-pending-requests=0 to ClientConnection(4 : Protocol(tcp socket: 192.168.1.10:10000 <- 192.168.1.18:50350))
    client   4 @09.544 process_clipboard_packet: clipboard-pending-requests, helper=ClipboardProtocolHelperCore
    client   4 @09.544 clipboard_progress(None, 0)
    client   4 @09.544 clipboard_notify(0) notification timer=None
    

Change History (8)

comment:1 Changed 4 weeks ago by Antoine Martin

Description: modified (diff)
Priority: majorcritical
Status: newassigned

comment:2 Changed 4 weeks ago by Antoine Martin

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

comment:3 Changed 4 weeks ago by 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.

comment:4 Changed 4 weeks ago by 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

comment:5 Changed 4 weeks ago by Antoine Martin

Probably fixed in r24231. Will test some more.

comment:6 Changed 4 weeks ago by Antoine Martin

Resolution: fixed
Status: assignedclosed

comment:7 Changed 4 weeks ago by Antoine Martin

Resolution: fixed
Status: closedreopened

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

comment:8 Changed 4 weeks ago by Antoine Martin

Resolution: fixed
Status: reopenedclosed

The correct fix is in r24247.

Note: See TracTickets for help on using tickets.