Skip to content

Commit

Permalink
#276: we have to send the token even when we cannot send the clipboar…
Browse files Browse the repository at this point in the history
…d data, so that the other ends knows it needs to notify us of clipboard changes (we set the greedy flag)

git-svn-id: https://xpra.org/svn/Xpra/trunk@15799 3bb7dfac-3a0b-4e04-842a-767bc560f471
  • Loading branch information
totaam committed May 10, 2017
1 parent 34ee65d commit 452205c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/xpra/clipboard/clipboard_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -251,9 +251,9 @@ def _send_clipboard_token_handler(self, proxy):
rsel = self.local_to_remote(selection)
def send_token(*args):
self.send("clipboard-token", *args)
if proxy._can_receive and not proxy._can_send:
if not proxy._can_send:
#send the token without data,
#and with claim flag set to False, greedy set to True:
#and with claim flag set to False, greedy set to True
send_token(rsel, [], "NOTARGET", "UTF8_STRING", 8, "bytes", "", False, True)
return
if self._want_targets:
Expand Down Expand Up @@ -538,7 +538,7 @@ def do_owner_changed(self, *args):
#an application on our side owns the clipboard selection
#(they are ready to provide something via the clipboard)
log("clipboard: %s owner_changed, enabled=%s, can-send=%s, can-receive=%s, have_token=%s, greedy_client=%s, block_owner_change=%s", self._selection, self._enabled, self._can_send, self._can_receive, self._have_token, self._greedy_client, self._block_owner_change)
if not self._enabled or self._block_owner_change or not self._can_send:
if not self._enabled or self._block_owner_change:
return
if self._have_token or self._greedy_client:
if self._have_token or DELAY_SEND_TOKEN<0:
Expand Down Expand Up @@ -670,7 +670,7 @@ def do_selection_clear_event(self, event):
# Someone else on our side has the selection
log("do_selection_clear_event(%s) have_token=%s, block_owner_change=%s selection=%s", event, self._have_token, self._block_owner_change, self._selection)
self._selection_clear_events += 1
if self._enabled and self._can_send and not self._block_owner_change:
if self._enabled and not self._block_owner_change:
#if greedy_client is set, do_owner_changed will fire the token
#so don't bother sending it now (same if we don't have it)
send = ((self._greedy_client and not self._block_owner_change) or self._have_token)
Expand Down

0 comments on commit 452205c

Please sign in to comment.