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

Clipboard integration broken with xpra over ssh #344

Closed
totaam opened this issue May 22, 2013 · 14 comments
Closed

Clipboard integration broken with xpra over ssh #344

totaam opened this issue May 22, 2013 · 14 comments

Comments

@totaam
Copy link
Collaborator

totaam commented May 22, 2013

Issue migrated from trac ticket # 344

component: client | priority: major | resolution: fixed

2013-05-22 13:01:59: krlmlr created the issue


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.

@totaam
Copy link
Collaborator Author

totaam commented May 22, 2013

2013-05-22 13:49:50: antoine commented


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

@totaam
Copy link
Collaborator Author

totaam commented May 22, 2013

2013-05-22 14:10:20: krlmlr commented


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

@totaam
Copy link
Collaborator Author

totaam commented May 22, 2013

2013-05-22 14:15:05: antoine commented


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

@totaam
Copy link
Collaborator Author

totaam commented May 22, 2013

2013-05-22 14:21:18: krlmlr commented


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

@totaam
Copy link
Collaborator Author

totaam commented May 22, 2013

2013-05-22 14:22:26: antoine commented


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.

@totaam
Copy link
Collaborator Author

totaam commented May 22, 2013

2013-05-22 14:27:01: krlmlr commented


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 :-)

@totaam
Copy link
Collaborator Author

totaam commented May 22, 2013

2013-05-22 14:34:08: antoine commented


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

using svn:

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

@totaam
Copy link
Collaborator Author

totaam commented May 22, 2013

2013-05-22 14:46:13: krlmlr commented


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¢...

@totaam
Copy link
Collaborator Author

totaam commented May 22, 2013

2013-05-22 14:48:50: antoine commented


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

[[BR]]

As for the error you encountered, that's because your version of libav is too old, so you need the [/browser/xpra/tags/v0.9.x/src/patches/old-libav.patch patches/old-libav.patch]

@totaam
Copy link
Collaborator Author

totaam commented May 22, 2013

2013-05-22 14:53:37: krlmlr commented


With the patch in #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.

@totaam
Copy link
Collaborator Author

totaam commented May 22, 2013

2013-05-22 14:56:53: antoine changed status from new to closed

@totaam
Copy link
Collaborator Author

totaam commented May 22, 2013

2013-05-22 14:56:53: antoine changed resolution from ** to fixed

@totaam
Copy link
Collaborator Author

totaam commented May 22, 2013

2013-05-22 14:56:53: antoine commented


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

[[BR]]

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!

@totaam totaam closed this as completed May 22, 2013
@totaam
Copy link
Collaborator Author

totaam commented May 22, 2013

2013-05-22 15:02:22: krlmlr commented


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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant