Skip to content

Commit

Permalink
#84 partial revert of r490: when we convert atoms from wire back to t…
Browse files Browse the repository at this point in the history
…he 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
  • Loading branch information
totaam committed Mar 15, 2012
1 parent 1e139e9 commit 94d24bd
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 16 deletions.
9 changes: 0 additions & 9 deletions src/wimpiggy/lowlevel/bindings.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand Down
11 changes: 4 additions & 7 deletions src/xpra/xposix/xclipboard.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand All @@ -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)

0 comments on commit 94d24bd

Please sign in to comment.