Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

macos client, server-to-client clipboard no longer works #2019

Closed
totaam opened this issue Oct 30, 2018 · 15 comments
Closed

macos client, server-to-client clipboard no longer works #2019

totaam opened this issue Oct 30, 2018 · 15 comments
Labels

Comments

@totaam
Copy link
Collaborator

totaam commented Oct 30, 2018

Issue migrated from trac ticket # 2019

component: clipboard | priority: critical | resolution: fixed | keywords: macos client clipboard

2018-10-30 07:35:52: sto6 created the issue


Connecting to xfce4 desktop on centos-6.6, xpra v1.0.12-19800, from macos 10.13.6.

When I upgraded macos cilent to 2.4 from 2.2.4, clipboard server-to-client no longer worked.
Then I went backwards to find latest release where it does work. Observations:

client versions (all non-python3, all installed from .pkg) vs clipboard:

works: xpra v2.2.6-18959   both dirs work
FAILS: xpra v2.3.1-[r19532](../commit/f8ce3313ec3fa786d43f98d361c0192fc890d139)   both dirs FAIL
FAILS: xpra v2.3.2-[r19729](../commit/62e196656ebd10faa40ec60429a74e8a4c6473ef)   both dirs FAIL
(ssh connect FAIL: xpra v2.3.3-20112)
FAILS: xpra v2.3.4-20510   server to client FAIL
FAILS: xpra v2.4-20679     server to client FAIL

Test sequence for server-to-client:

I start the macos client like this (usually use the launcher form, taking these options from a file):

xpra attach ssh/me@joe.example.com/3 --desktop-fullscreen=yes --desktop-scaling=no --speed=100 --quality=100 --dpi=96 --swap-keys=no  --opengl=yes

In remote desktop I start Terminal from this centos package:

Terminal-0.4.7-2.el6.x86_64 : X Terminal Emulator for the Xfce Desktop environment

In remote desktop Terminal, type text "xyz123", select it with mouse, and use Terminal's menu item: Edit/Copy.
I hide the xpra-client (cmd-H). I try to paste (cmd-V) in a macos terminal. When it fails, the macos terminal's Edit/Paste is also greyed-out (not clickable) indicating nothing to paste.

When I run client with "--debug clipboard" I do see the selected text "xyz123" referenced in the logs. But from what I can tell, neither 2.2.6 nor 2.4 logs anything regarding the clipboard or that text at the moment of macos cmd-V to paste in macos.

I haven't used 2.4 enough yet, but it seems a bit worse on macos than 2.3.4 (features and possibly non-opengl performance). And 2.3.4 at least works half-way; so I'd be interested in a way to get 2.3.4 working. Otherwise 2.2.6 is acceptable for me.

I read the wiki on clipboard, nothing jumps out at me. Don't think I have another clipboard manager. And I'm always testing using the CLIPBOARD clipboard (not the primary). In 2.3.4 where the client-menu works for me, I tried changing clipboard-menu to disabled and back to clipboard, but was no help.

@totaam
Copy link
Collaborator Author

totaam commented Oct 30, 2018

2018-10-30 08:40:58: antoine changed status from new to closed

@totaam
Copy link
Collaborator Author

totaam commented Oct 30, 2018

2018-10-30 08:40:58: antoine set resolution to duplicate

@totaam
Copy link
Collaborator Author

totaam commented Oct 30, 2018

2018-10-30 08:40:58: antoine commented


The clipboard issue is a duplicate of #2009 (already fixed)

but it seems a bit worse on macos than 2.3.4 (features and possibly non-opengl performance)
What "features"? Non-opengl performance is unchanged.
Please file a separate ticket for those, if any.

@totaam
Copy link
Collaborator Author

totaam commented Oct 30, 2018

2018-10-30 09:22:48: sto6 commented


Found a traceback in only the v2.4-20679 client log, perhaps not relevant? Here it is with some context:

...
2018-10-29 23:14:48,452 DISCARD_TARGETS=^SAVE_TARGETS$, ^COMPOUND_TEXT, ^NeXT, ^com\.apple\., ^CorePasteboardFlavorType, ^dyn\.
2018-10-29 23:14:48,454 server clipboard: supported=True, direction=both, supports enable selection=True
2018-10-29 23:14:48,454 client clipboard: supported=True, direction=both
2018-10-29 23:14:48,454 parse_clipboard_caps() clipboard enabled=True
2018-10-29 23:14:48,455 enabled remote logging
2018-10-29 23:14:48,455 Xpra X11 desktop server version 1.0.12-19800 64-bit
2018-10-29 23:14:48,456  running on Linux CentOS 6.6 Final
2018-10-29 23:14:48,458 process_ui_capabilities() clipboard_enabled=True
2018-10-29 23:14:48,458 get_clipboard_helper_classes() unfiltered list=['xpra.platform.darwin.osx_clipboard.OSXClipboardProtocolHelper', 'xpra.clipboard.gdk_clipboard.GDKClipboardProtocolHelper', 'xpra.clipboard.clipboard_base.DefaultClipboardProtocolHelper', 'xpra.clipboard.translated_clipboard.TranslatedClipboardProtocolHelper']
2018-10-29 23:14:48,460 get_clipboard_helper_classes() options=['xpra.platform.darwin.osx_clipboard.OSXClipboardProtocolHelper', 'xpra.clipboard.gdk_clipboard.GDKClipboardProtocolHelper', 'xpra.clipboard.clipboard_base.DefaultClipboardProtocolHelper', 'xpra.clipboard.translated_clipboard.TranslatedClipboardProtocolHelper']
2018-10-29 23:14:48,490 get_clipboard_helper_classes()=[<class 'xpra.platform.darwin.osx_clipboard.OSXClipboardProtocolHelper'>, <class 'xpra.clipboard.gdk_clipboard.GDKClipboardProtocolHelper'>, <class 'xpra.clipboard.clipboard_base.DefaultClipboardProtocolHelper'>, <class 'xpra.clipboard.translated_clipboard.TranslatedClipboardProtocolHelper'>]
2018-10-29 23:14:48,491 make_clipboard_helper() options=[<class 'xpra.platform.darwin.osx_clipboard.OSXClipboardProtocolHelper'>, <class 'xpra.clipboard.gdk_clipboard.GDKClipboardProtocolHelper'>, <class 'xpra.clipboard.clipboard_base.DefaultClipboardProtocolHelper'>, <class 'xpra.clipboard.translated_clipboard.TranslatedClipboardProtocolHelper'>]
2018-10-29 23:14:48,491 setup_clipboard_helper(<class 'xpra.platform.darwin.osx_clipboard.OSXClipboardProtocolHelper'>)
2018-10-29 23:14:48,491 setup_clipboard_helper() kwargs={'clipboard.remote': 'CLIPBOARD', 'can-send': True, 'clipboard.local': 'CLIPBOARD', 'clipboards.remote': ['CLIPBOARD', 'PRIMARY', 'SECONDARY'], 'remote-loop-uuids': {}, 'clipboards.local': ['CLIPBOARD'], 'can-receive': True}
2018-10-29 23:14:48,518 NSPasteboard.changeCount() access success, current value=282, setting up timer to watch for changes
2018-10-29 23:14:48,520 UI watcher=<xpra.platform.ui_thread_watcher.UI_thread_watcher object at 0x10f0214d0>
2018-10-29 23:14:48,520 TranslatedClipboardProtocolHelper local=CLIPBOARD, remote=CLIPBOARD
2018-10-29 23:14:48,529 OSXClipboardProtocolHelper.init_proxies : {'CLIPBOARD': ClipboardProxy(CLIPBOARD)}
2018-10-29 23:14:48,530 verify_remote_loop_uuids({})
2018-10-29 23:14:48,530 clipboard helper=OSXClipboardProtocolHelper
2018-10-29 23:14:48,530 send_clipboard_selections(['CLIPBOARD']) server_clipboard_enable_selections=True
2018-10-29 23:14:48,531 send clipboard token: CLIPBOARD
2018-10-29 23:14:48,531 local_to_remote(CLIPBOARD) local_clipboard=CLIPBOARD, remote_clipboard=CLIPBOARD
Traceback (most recent call last):
  File "/Applications/Xpra.app/Contents/Resources/lib/python/xpra/client/gtk_base/gtk_client_base.py", line 864, in process_ui_capabilities
    UIXpraClient.process_ui_capabilities(self)
  File "/Applications/Xpra.app/Contents/Resources/lib/python/xpra/client/ui_client_base.py", line 409, in process_ui_capabilities
    self.keyboard_helper.set_modifier_mappings(modifier_keycodes)
  File "/Applications/Xpra.app/Contents/Resources/lib/python/xpra/client/keyboard_helper.py", line 46, in set_modifier_mappings
    self.keyboard.set_modifier_mappings(mappings)
  File "/Applications/Xpra.app/Contents/Resources/lib/python/xpra/platform/darwin/keyboard.py", line 141, in set_modifier_mappings
    KeyboardBase.set_modifier_mappings(self, mappings)
  File "/Applications/Xpra.app/Contents/Resources/lib/python/xpra/platform/keyboard_base.py", line 45, in set_modifier_mappings
    self.modifier_keys[bytestostr(keyname)] = bytestostr(modifier)
UnboundLocalError: local variable 'keyname' referenced before assignment
2018-10-29 23:14:48,536 timer_clipboard_check() was 0, now 282
2018-10-29 23:14:48,536 local_clipboard_changed()
2018-10-29 23:14:48,536 clipboard: CLIPBOARD owner_changed, enabled=True, can-send=True, can-receive=True, have_token=False, greedy_client=False, block_owner_change=False
2018-10-29 23:14:49,037 timer_clipboard_check() was 282, now 282
2018-10-29 23:14:49,297 process_clipboard_packet: clipboard-pending-requests, helper=OSXClipboardProtocolHelper
2018-10-29 23:14:49,297 process clipboard handler(clipboard-pending-requests)=<bound method OSXClipboardProtocolHelper._process_clipboard_pending_requests of OSXClipboardProtocolHelper>
2018-10-29 23:14:49,297 clipboard_progress(None, 1)
2018-10-29 23:14:49,297 clipboard_notify(1)
2018-10-29 23:14:49,298 process_clipboard_packet: clipboard-request, helper=OSXClipboardProtocolHelper
2018-10-29 23:14:49,298 process clipboard handler(clipboard-request)=<bound method OSXClipboardProtocolHelper._process_clipboard_request of OSXClipboardProtocolHelper>
2018-10-29 23:14:49,298 remote_to_local(CLIPBOARD) local_clipboard=CLIPBOARD, remote_clipboard=CLIPBOARD
2018-10-29 23:14:49,298 process clipboard request, request_id=0, selection=CLIPBOARD, local name=CLIPBOARD, target=TARGETS
2018-10-29 23:14:49,298 get_contents(TARGETS, <function got_contents at 0x11f0f3cf8>) selection=CLIPBOARD, enabled=True, can-send=True
2018-10-29 23:14:49,369 got_targets(<gtk.Clipboard object at 0x10d50b230 (GtkClipboard at 0x7fd5621390b0)>, ('UTF8_STRING', 'public.utf8-plain-text'), (None,))
2018-10-29 23:14:49,369 got_contents(ATOM, 32, <type 'tuple'>:2) data=0x2827555446385f535452494e47272c20277075626c69632e757466382d706c61696e2d746578742729..
2018-10-29 23:14:49,370 _munge_raw_selection_to_wire('TARGETS', 'ATOM', 32, ('UTF8_STRING', 'public.utf8-plain-text'))
2018-10-29 23:14:49,371 _filter_targets(('UTF8_STRING', 'public.utf8-plain-text'))=['UTF8_STRING', 'public.utf8-plain-text']
2018-10-29 23:14:49,371 clipboard raw -> wire: ('ATOM', 32, ('UTF8_STRING', 'public.utf8-plain-text')) -> ('atoms', ['UTF8_STRING', 'public.utf8-plain-text'])
2018-10-29 23:14:49,426 process_clipboard_packet: clipboard-pending-requests, helper=OSXClipboardProtocolHelper
2018-10-29 23:14:49,426 process clipboard handler(clipboard-pending-requests)=<bound method OSXClipboardProtocolHelper._process_clipboard_pending_requests of OSXClipboardProtocolHelper>
2018-10-29 23:14:49,426 clipboard_progress(None, 0)
2018-10-29 23:14:49,427 clipboard_notify(0)
2018-10-29 23:14:49,539 timer_clipboard_check() was 282, now 282
2018-10-29 23:14:50,044 timer_clipboard_check() was 282, now 282
...
2018-10-29 23:15:10,140 timer_clipboard_check() was 282, now 282
2018-10-29 23:15:10,239 process_clipboard_packet: clipboard-token, helper=OSXClipboardProtocolHelper
2018-10-29 23:15:10,239 process clipboard handler(clipboard-token)=<bound method OSXClipboardProtocolHelper._process_clipboard_token of OSXClipboardProtocolHelper>
2018-10-29 23:15:10,239 remote_to_local(CLIPBOARD) local_clipboard=CLIPBOARD, remote_clipboard=CLIPBOARD
2018-10-29 23:15:10,240 process clipboard token selection=CLIPBOARD, local clipboard name=CLIPBOARD, proxy=ClipboardProxy(CLIPBOARD)
2018-10-29 23:15:10,240 wire selection to raw, encoding=bytes, type=UTF8_STRING, format=8, len(data)=6
2018-10-29 23:15:10,241 got token, selection=CLIPBOARD, targets=('TIMESTAMP', 'TARGETS', 'MULTIPLE', 'SAVE_TARGETS', 'UTF8_STRING', 'COMPOUND_TEXT', 'TEXT', 'STRING', 'text/plain;charset=utf-8', 'text/plain;charset=ANSI_X3.4-1968', 'text/plain'), target data={'UTF8_STRING': 'xyz123'}, claim=True, can-receive=True
2018-10-29 23:15:10,261 clipboard CLIPBOARD set to *xyz123*
2018-10-29 23:15:10,262 claim() selection=CLIPBOARD, enabled=True
2018-10-29 23:15:10,262 change count now at 283
2018-10-29 23:15:10,263 remove_block: CLIPBOARD
2018-10-29 23:15:10,642 timer_clipboard_check() was 283, now 283
...

@totaam
Copy link
Collaborator Author

totaam commented Oct 30, 2018

2018-10-30 09:39:28: antoine commented


Found a traceback ...
UnboundLocalError: local variable 'keyname' referenced before assignment

This keyboard mapping error only affected newer clients with older servers (ie: 1.x) and is already fixed in r20817.

@totaam
Copy link
Collaborator Author

totaam commented Nov 1, 2018

2018-11-01 21:07:44: sto6 commented


Tried macos client version: Xpra-x86_64-2.4.1-r20898.pkg, still server-to-client clipboard failed for me.

#2009 was about reverse direction: client -> server.
In my case, I couldn't find a similar message as: Warning: sanitizing invalid gtk selection.

@totaam
Copy link
Collaborator Author

totaam commented Nov 2, 2018

2018-11-02 00:59:43: antoine commented


Tried macos client version: Xpra-x86_64-2.4.1-r20898.pkg, still server-to-client clipboard failed for me.
What is your server version?

@totaam
Copy link
Collaborator Author

totaam commented Nov 2, 2018

2018-11-02 01:36:53: sto6 commented


Server: centos-6.6, xpra v1.0.12-19800

# yum list installed | g xpra
ffmpeg-xpra.x86_64                      4.0.2-1.el6_6            @winswitch
libvpx-xpra.x86_64                      1.7.0-1.el6_6            @winswitch
python-pyopengl.x86_64                  3.1.1a1-4.1xpra3.el6_6   @winswitch
x264-xpra.x86_64                        20170301-1.el6_6         @winswitch
xpra.x86_64                             1.0.12-2.19800.el6_6    @winswitch
xpra-common.noarch                      1.0.12-2.19800.el6_6    @winswitch

@totaam
Copy link
Collaborator Author

totaam commented Nov 2, 2018

2018-11-02 01:38:49: antoine changed status from closed to reopened

@totaam
Copy link
Collaborator Author

totaam commented Nov 2, 2018

2018-11-02 01:38:49: antoine removed resolution (was duplicate)

@totaam
Copy link
Collaborator Author

totaam commented Nov 28, 2018

2018-11-28 12:10:17: antoine changed priority from major to critical

@totaam
Copy link
Collaborator Author

totaam commented Nov 28, 2018

2018-11-28 12:10:17: antoine commented


I can reproduce. Odd this one.
As per the log, we do set the clipboard:

clipboard CLIPBOARD set to *xyz123*

But somehow the value doesn't stick.
Maybe we overwrite it when we claim() the clipboard, or maybe a GTK update changed the clipboard behaviour.

@totaam
Copy link
Collaborator Author

totaam commented Nov 28, 2018

2018-11-28 15:38:25: antoine changed status from reopened to closed

@totaam
Copy link
Collaborator Author

totaam commented Nov 28, 2018

2018-11-28 15:38:25: antoine set resolution to fixed

@totaam
Copy link
Collaborator Author

totaam commented Nov 28, 2018

2018-11-28 15:38:25: antoine commented


This was caused by r18248 (GTK3 compatibility code) and only affects GTK2 on macos where it seems that the clipboard.set_with_data function doesn't do anything.
Fix is in r21135. (tiny backport in 21136)

There are beta 2.5 and 2.4.2+ packages with these fixes here: [https://xpra.org/beta/osx/]

@totaam totaam closed this as completed Nov 28, 2018
@totaam totaam added the v2.4.x label Jan 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant