From 94d24bd4710d1a6c13a93d8c3b363d4cbfc2578b Mon Sep 17 00:00:00 2001 From: Antoine Martin Date: Thu, 15 Mar 2012 11:00:08 +0000 Subject: [PATCH] #84 partial revert of r490: when we convert atoms from wire back to the display we don't want to use gdk atoms (which may have a different value from the x11 atoms they represent!), just create x11 atoms directly via get_xatom git-svn-id: https://xpra.org/svn/Xpra/trunk@598 3bb7dfac-3a0b-4e04-842a-767bc560f471 --- src/wimpiggy/lowlevel/bindings.pyx | 9 --------- src/xpra/xposix/xclipboard.py | 11 ++++------- 2 files changed, 4 insertions(+), 16 deletions(-) diff --git a/src/wimpiggy/lowlevel/bindings.pyx b/src/wimpiggy/lowlevel/bindings.pyx index 07dc949cf5..853e955c17 100644 --- a/src/wimpiggy/lowlevel/bindings.pyx +++ b/src/wimpiggy/lowlevel/bindings.pyx @@ -438,15 +438,6 @@ def gdk_atom_objects_from_gdk_atom_array(atom_string): objects.append(PyGdkAtom_New(array[i])) return objects -def gdk_atom_array_from_gdk_atoms(strs_or_xatoms): - a = [] - for str_or_xatom in strs_or_xatoms: - gdkatom = gtk.gdk.atom_intern(str_or_xatom) - if gdkatom: - v = PyGdkAtom_Get(gdkatom) - a.append(v) - return a - # Property handling: diff --git a/src/xpra/xposix/xclipboard.py b/src/xpra/xposix/xclipboard.py index 4e6e125934..b4e12c3386 100644 --- a/src/xpra/xposix/xclipboard.py +++ b/src/xpra/xposix/xclipboard.py @@ -5,10 +5,7 @@ import struct -from wimpiggy.lowlevel import ( - gdk_atom_objects_from_gdk_atom_array, #@UnresolvedImport - gdk_atom_array_from_gdk_atoms #@UnresolvedImport - ) +from wimpiggy.lowlevel import (get_xatom, gdk_atom_objects_from_gdk_atom_array) #@UnresolvedImport from wimpiggy.log import Logger log = Logger() @@ -33,7 +30,7 @@ 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": - gdkatoms = gdk_atom_array_from_gdk_atoms(data) - log.debug("gdkatoms(%s)=%s", data, gdkatoms) - return struct.pack("=" + "L" * len(gdkatoms), *gdkatoms) + 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) return ClipboardProtocolHelperBase._munge_wire_selection_to_raw(self, encoding, datatype, format, data)