Xpra: Ticket #344: Clipboard integration broken with xpra over ssh

When a server-side application tries to write to the clipboard (example: ls | xclip), the following error message appears on the client-side console running xpra:

Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/xpra/platform/clipboard_base.py", line 127, in _get_clipboard_from_remote_handler
    self.progress_cb(len(self._clipboard_outstanding_requests), None)
  File "/usr/lib/python2.7/dist-packages/xpra/platform/client_extras_base.py", line 192, in clipboard_progress
    self.set_icon("clipboard")
  File "/usr/lib/python2.7/dist-packages/xpra/xposix/gui.py", line 111, in set_icon
    self.set_icon_from_file(filename)
  File "/usr/lib/python2.7/dist-packages/xpra/xposix/gui.py", line 125, in set_icon_from_file
    self.tray_widget.set_from_pixbuf(pixbuf)
AttributeError: 'appindicator.Indicator' object has no attribute 'set_from_pixbuf'
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/xpra/platform/clipboard_base.py", line 127, in _get_clipboard_from_remote_handler
    self.progress_cb(len(self._clipboard_outstanding_requests), None)
  File "/usr/lib/python2.7/dist-packages/xpra/platform/client_extras_base.py", line 192, in clipboard_progress
    self.set_icon("clipboard")
  File "/usr/lib/python2.7/dist-packages/xpra/xposix/gui.py", line 111, in set_icon
    self.set_icon_from_file(filename)
  File "/usr/lib/python2.7/dist-packages/xpra/xposix/gui.py", line 125, in set_icon_from_file
    self.tray_widget.set_from_pixbuf(pixbuf)
AttributeError: 'appindicator.Indicator' object has no attribute 'set_from_pixbuf'

Nothing is transferred to the client clipboard.

The server-side xpra prints nothing, and nothing happens when a client application accesses the clipboard.

Ubuntu 13.04, Gnome Shell, xpra 0.8.8 on the server.



Wed, 22 May 2013 12:49:49 GMT - Antoine Martin:

Oh great, another Ubuntu appindicator related breakage... caused by #275 this time.

Does this fix the issue (untested - I am fortunate enough not to have this installed):

--- xpra/xposix/gui.py	(revision 3425)
+++ xpra/xposix/gui.py	(working copy)
@@ -8,7 +8,7 @@
 # may import gtk.
 import sys
-import os
+import os.path
 from wimpiggy.gobject_compat import import_gtk, import_gdk, is_gtk3
 gtk = import_gtk()
 gdk = import_gdk()
@@ -120,9 +120,14 @@
             self.tray_widget.set_from_file(filename)
         elif hasattr(self.tray_widget, "set_icon_from_file"):
             self.tray_widget.set_icon_from_file(filename)
-        else:
+        elif hasattr(self.tray_widget, "set_from_pixbuf"):
             pixbuf = gdk.pixbuf_new_from_file(filename)
             self.tray_widget.set_from_pixbuf(pixbuf)
+        elif hasattr(self.tray_widget, "set_icon_theme_path") and hasattr(self.tray_widget, "set_icon"):
+            t,i = os.path.split(filename)
+            self.tray_widget.set_icon_theme_path(t)
+            f, _  = os.path.splitext(i)
+            self.tray_widget.set_icon(f)
     def setup_statusicon(self, delay_tray, tray_icon_filename):
         self.tray_widget = None

Wed, 22 May 2013 13:10:19 GMT - krlmlr:

No. Using the Github version at git://github.com/dscho/Xpra.git, I'm now seeing the following message at startup:

cannot load vpx codec: cannot import name codec
cannot load x264 codec: cannot import name codec
xpra client version 0.9.0
2013-05-22 15:08:00,577 xpra.rencode is missing: 'module' object has no attribute 'rencode'
2013-05-22 15:08:00,667 GDK Clipboard failed to load: No module named gdk_atoms - using 'Default Clipboard' fallback
2013-05-22 15:08:00,673 make_clipboardmenuitem()
Traceback (most recent call last):
  File "/home/qqq/git/Xpra/src/xpra/platform/client_extras_base.py", line 569, in make_clipboardmenuitem
    from xpra.platform.translated_clipboard import TranslatedClipboardProtocolHelper
  File "/home/qqq/git/Xpra/src/xpra/platform/translated_clipboard.py", line 8, in <module>
    from xpra.platform.gdk_clipboard import GDKClipboardProtocolHelper
  File "/home/qqq/git/Xpra/src/xpra/platform/gdk_clipboard.py", line 9, in <module>
    from wimpiggy.gdk.gdk_atoms import (
ImportError: No module named gdk_atoms
2013-05-22 15:08:00,781 cannot import x11 bell bindings (will use gtk fallback) : No module named bindings
2013-05-22 15:08:00,803 failed to use raw x11 keymap: No module named bindings
2013-05-22 15:08:00,803 failed to use native get_modifier_mappings: No module named bindings
2013-05-22 15:08:00,821 failed to get keyboard repeat rate: No module named bindings
2013-05-22 15:08:00,854 failed to load X11 properties/settings bindings: No module named bindings - root window properties will not be propagated
2013-05-22 15:08:00,854 Attached to ssh:XXX:1 (press Control-C to detach)

and the following when calling ls|xclip on the server:

Traceback (most recent call last):
  File "/home/qqq/git/Xpra/src/xpra/platform/client_extras_base.py", line 174, in process_clipboard_packet
    self.clipboard_helper.process_clipboard_packet(packet)
  File "/home/qqq/git/Xpra/src/xpra/platform/clipboard_base.py", line 289, in process_clipboard_packet
    self._packet_handlers[packet_type](packet)
  File "/home/qqq/git/Xpra/src/xpra/platform/clipboard_base.py", line 272, in _process_clipboard_contents
    raw_data = self._munge_wire_selection_to_raw(wire_encoding, dtype, dformat, wire_data)
  File "/home/qqq/git/Xpra/src/xpra/platform/clipboard_base.py", line 233, in _munge_wire_selection_to_raw
    raise Exception("unhanled encoding: %s" % encoding)
Exception: unhanled encoding: atoms

I'm using the following to run xpra from source:

PYTHONPATH=/home/qqq/git/Xpra/src /home/qqq/git/Xpra/src/scripts/xpra

Wed, 22 May 2013 13:15:04 GMT - Antoine Martin:

Looks like the instructions you are following are out of date. FYI: 0.8.x branch is dead and unmaintained, and so is this git tree by the looks of things.

You need all the cython .so on your PYTHONPATH, see INSTALL


Wed, 22 May 2013 13:21:17 GMT - krlmlr:

Where can I checkout (Subversion or Git) the current Xpra source?


Wed, 22 May 2013 13:22:25 GMT - Antoine Martin:

err, here, as in right on the home page: http://xpra.org/

Note: trunk is being worked on, so it is best to stick with the 0.9.x tag for testing - at least for now.


Wed, 22 May 2013 13:27:00 GMT - krlmlr:

Well... I can "browse source" with Trac, but there's no hint on where the source repository lives. Also no instructions under "BUILD". "SOURCE" is just a file listing without as much as a README file. The home page is the last place I would have looked for forking/checkout instructions. And I didn't :-)


Wed, 22 May 2013 13:34:07 GMT - Antoine Martin:

OK, that link I posted... has a big section entitled: "Repository".

using svn:

svn co http://www.xpra.org/svn/Xpra/

Wed, 22 May 2013 13:46:12 GMT - krlmlr:

Building xpra, according to the build instructions, from revision 3486 of http://winswitch.org/svn/Xpra/tags/v0.9.x/src leads to:

building 'xpra.x264.codec' extension
x86_64-linux-gnu-gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/usr/include/python2.7 -c xpra/x264/codec.c \
    -o build/temp.linux-x86_64-2.7/xpra/x264/codec.o -Wall -Werror=implicit-function-declaration -fPIC
x86_64-linux-gnu-gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/usr/include/python2.7 -c xpra/x264/x264lib.c \
    -o build/temp.linux-x86_64-2.7/xpra/x264/x264lib.o -Wall -Werror=implicit-function-declaration -fPIC
xpra/x264/x264lib.c: In function ‘do_clean_decoder’:
xpra/x264/x264lib.c:430:3: error: implicit declaration of function ‘avcodec_free_frame’ [-Werror=implicit-function-declaration]
cc1: some warnings being treated as errors
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

PS.: I have found the repository URL with your help. I was just saying that it's "hidden" very well... on the front page. You might want to consider repeating this information under "BUILDING", adding a README to the "SOURCE" directory and/or persuading Trac to always show the true repository URL for any given view. My 2¢...


Wed, 22 May 2013 13:48:49 GMT - Antoine Martin:

Hah, gotcha - you're right, we should try to make it more prominent..


As for the error you encountered, that's because your version of libav is too old, so you need the patches/old-libav.patch


Wed, 22 May 2013 13:53:37 GMT - krlmlr:

With the patch in ticket:344#comment:1 , clipboarding works like a charm again. Which version will this patch be scheduled for?

Note that the "BUILDING" page refers to non-existing browser/trunk/src/disable-x264.patch.

Thanks for your help.


Wed, 22 May 2013 13:56:53 GMT - Antoine Martin: status changed; resolution set

Applied in r3487 - this will go in 0.9.4, due in just a few days time.


Thank you very much for testing, and for your patience with the various broken links and non-obvious instructions. We shall try to do better on that too!


Wed, 22 May 2013 14:02:22 GMT - krlmlr:

My pleasure. Thanks again for your responsiveness and kind help.


Sat, 23 Jan 2021 04:52:16 GMT - migration script:

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