Skip to content

Commit

Permalink
flatten clipboard data bundled with "clipboard-token" so we don't end…
Browse files Browse the repository at this point in the history
… up inlining compressed wrappers in nested structures

git-svn-id: https://xpra.org/svn/Xpra/trunk@4644 3bb7dfac-3a0b-4e04-842a-767bc560f471
  • Loading branch information
totaam committed Oct 31, 2013
1 parent 38fd5c1 commit 96aa6a6
Showing 1 changed file with 11 additions and 13 deletions.
24 changes: 11 additions & 13 deletions src/xpra/clipboard/clipboard_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,15 +156,11 @@ def _process_clipboard_token(self, packet):
target_data = None
if len(packet)>=3:
targets = packet[2]
if len(packet)>=4:
raw_target_data = packet[3]
if raw_target_data:
#raw_target_data = {target : (dtype, dformat, wire_encoding, wire_data) }
target_data = {}
for target, data in raw_target_data.items():
dtype, dformat, wire_encoding, wire_data = data
raw_data = self._munge_wire_selection_to_raw(wire_encoding, dtype, dformat, wire_data)
target_data[target] = raw_data
if len(packet)>=8:
target_data = {}
target, dtype, dformat, wire_encoding, wire_data = packet[3:8]
raw_data = self._munge_wire_selection_to_raw(wire_encoding, dtype, dformat, wire_data)
target_data[target] = raw_data
proxy.got_token(targets, target_data)

def _get_clipboard_from_remote_handler(self, proxy, selection, target):
Expand Down Expand Up @@ -220,10 +216,12 @@ def got_contents(dtype, dformat, data):
send_targets_only()
return
wire_data = self._may_compress(dtype, dformat, wire_data)
if wire_data:
target_data = {target : (dtype, dformat, wire_encoding, wire_data) }
debug("sending token with target data: %s", target_data)
self.send("clipboard-token", rsel, targets, target_data)
if not wire_data:
send_targets_only()
return
target_data = (target, dtype, dformat, wire_encoding, wire_data)
debug("sending token with target data: %s", target_data)
self.send("clipboard-token", rsel, targets, *target_data)
proxy.get_contents(target, got_contents)
proxy.get_contents("TARGETS", got_targets)
return
Expand Down

0 comments on commit 96aa6a6

Please sign in to comment.