diff --git a/src/wimpiggy/lowlevel/bindings.pyx b/src/wimpiggy/lowlevel/bindings.pyx index 1b4fffe5e0..c91170dd23 100644 --- a/src/wimpiggy/lowlevel/bindings.pyx +++ b/src/wimpiggy/lowlevel/bindings.pyx @@ -438,6 +438,16 @@ def gdk_atom_objects_from_gdk_atom_array(atom_string): objects.append(PyGdkAtom_New(array[i])) return objects +def gdk_atom_array_from_gdk_atom_objects(gdk_atom_objects): + cdef GdkAtom c_gdk_atom + cdef unsigned long gdk_atom_value + atom_array = [] + for atom_object in gdk_atom_objects: + c_gdk_atom = PyGdkAtom_Get(atom_object) + gdk_atom_value = c_gdk_atom + atom_array.append(gdk_atom_value) + return atom_array + # Property handling: diff --git a/src/xpra/xposix/xclipboard.py b/src/xpra/xposix/xclipboard.py index b4e12c3386..f5e1b420b6 100644 --- a/src/xpra/xposix/xclipboard.py +++ b/src/xpra/xposix/xclipboard.py @@ -5,7 +5,8 @@ import struct -from wimpiggy.lowlevel import (get_xatom, gdk_atom_objects_from_gdk_atom_array) #@UnresolvedImport +from wimpiggy.lowlevel import (gdk_atom_objects_from_gdk_atom_array, #@UnresolvedImport + gdk_atom_array_from_gdk_atom_objects) #@UnresolvedImport from wimpiggy.log import Logger log = Logger() @@ -30,7 +31,8 @@ def _do_munge_raw_selection_to_wire(self, type, format, data): def _munge_wire_selection_to_raw(self, encoding, datatype, format, data): if encoding == "atoms": - ints = [get_xatom(a) for a in data] - log.debug("wire to raw: atoms(%s)=%s", data, ints) - return struct.pack("=" + "L" * len(ints), *ints) + import gtk.gdk + gdk_atoms = [gtk.gdk.atom_intern(a) for a in data] + atom_array = gdk_atom_array_from_gdk_atom_objects(gdk_atoms) + return struct.pack("=" + "I" * len(atom_array), *atom_array) return ClipboardProtocolHelperBase._munge_wire_selection_to_raw(self, encoding, datatype, format, data)