Skip to content

Commit

Permalink
#452 detect clipboard loops and disable clipboard temporarily
Browse files Browse the repository at this point in the history
git-svn-id: https://xpra.org/svn/Xpra/trunk@4845 3bb7dfac-3a0b-4e04-842a-767bc560f471
  • Loading branch information
totaam committed Dec 3, 2013
1 parent c2c97f4 commit 8c4d931
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/xpra/clipboard/clipboard_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -540,6 +540,14 @@ def do_selection_get(self, selection_data, info, time):
assert self._selection == str(selection_data.selection)
target = str(selection_data.target)
self._request_contents_events += 1
#check for clipboard loops:
if gtk.main_level()>=20:
log.warn("clipboard loop nesting too deep: %s", gtk.main_level())
log.warn("you may have a clipboard forwarding loop, temporarily disabling the clipboard")
log.warn("it may be best to disable the clipboard completely")
self.set_enabled(False)
gobject.timeout_add(60*1000, self.set_enabled, True)
return
result = self.emit("get-clipboard-from-remote", self._selection, target)
if result is None or result["type"] is None:
debug("remote selection fetch timed out or empty")
Expand Down

0 comments on commit 8c4d931

Please sign in to comment.