xpra icon
Bug tracker and wiki

This bug tracker and wiki are being discontinued
please use https://github.com/Xpra-org/xpra instead.


Ticket #176: fix-clipboard.patch

File fix-clipboard.patch, 2.0 KB (added by onlyjob, 9 years ago)

patch: partial revert of r1230

  • xpra/xposix/xclipboard.py

    Last-Update: 2012-08-11
    Author: Dmitry Smirnov <onlyjob@member.fsf.org>
    Forwarded: 2012-08-11
    Bug-Xpra: https://www.xpra.org/trac/ticket/176
    Description: fix clipboard regression
     Reverting back to 0.4.0
    
    a b  
    2020    def __init__(self, send_packet_cb):
    2121        ClipboardProtocolHelperBase.__init__(self, send_packet_cb, ["CLIPBOARD", "PRIMARY", "SECONDARY"])
    2222
    23     def _do_munge_raw_selection_to_wire(self, target, dtype, dformat, data):
    24         if dformat == 32 and dtype in ("ATOM", "ATOM_PAIR"):
     23    def _do_munge_raw_selection_to_wire(self, target, ype, format, data):
     24        if format == 32 and type in ("ATOM", "ATOM_PAIR"):
    2525            # Convert to strings and send that. Bizarrely, the atoms are
    2626            # not actual X atoms, but an array of GdkAtom's reinterpreted
    2727            # as a byte buffer.
     
    3131                atom_names.remove("SAVE_TARGETS")
    3232                atom_names.remove("COMPOUND_TEXT")
    3333            return ("atoms", atom_names)
    34         return ClipboardProtocolHelperBase._do_munge_raw_selection_to_wire(self, target, dtype, dformat, data)
     34        return ClipboardProtocolHelperBase._do_munge_raw_selection_to_wire(self, target, type, format, data)
    3535
    36     def _munge_wire_selection_to_raw(self, encoding, dtype, dformat, data):
     36    def _munge_wire_selection_to_raw(self, encoding, datatype, format, data):
    3737        if encoding == "atoms":
    3838            import gtk.gdk
    3939            gdk_atoms = [gtk.gdk.atom_intern(a) for a in data]
    4040            atom_array = gdk_atom_array_from_gdk_atom_objects(gdk_atoms)
    41             return struct.pack("=" + "L" * len(atom_array), *atom_array)
    42         return ClipboardProtocolHelperBase._munge_wire_selection_to_raw(self, encoding, dtype, dformat, data)
     41            return struct.pack("=" + "I" * len(atom_array), *atom_array)
     42        return ClipboardProtocolHelperBase._munge_wire_selection_to_raw(self, encoding, datatype, format, data)