Skip to content

Commit

Permalink
#812 honour enabled flag
Browse files Browse the repository at this point in the history
git-svn-id: https://xpra.org/svn/Xpra/trunk@22475 3bb7dfac-3a0b-4e04-842a-767bc560f471
  • Loading branch information
totaam committed Apr 20, 2019
1 parent 24ebc88 commit d36249f
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/xpra/x11/gtk_x11/clipboard.py
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,9 @@ def do_selection_request_event(self, event):
target = str(event.target)
def nodata():
self.set_selection_response(requestor, target, prop, "STRING", 8, b"", time=event.time)
if not self._enabled:
nodata()
return
if wininfo.startswith("'") and wininfo.endswith("'") and wininfo.strip("'") in BLACKLISTED_CLIPBOARD_CLIENTS:
if first_time("clipboard-blacklisted:%s" % wininfo.strip("'")):
log.warn("receiving clipboard requests from blacklisted client %s", wininfo)
Expand Down Expand Up @@ -420,6 +423,8 @@ def do_selection_notify_event(self, event):
owned = self.owned
self.owned = event.owner and get_xwindow(event.owner)==self.xid
log("do_selection_notify_event(%s) owned=%s, was %s", event, self.owned, owned)
if not self._enabled:
return
if self.owned or not self._can_send:
return
self.schedule_emit_token()
Expand Down Expand Up @@ -465,11 +470,15 @@ def got_targets(dtype, dformat, data):

def do_selection_clear_event(self, event):
log("do_xpra_selection_clear(%s) was owned=%s", event, self.owned)
if not self._enabled:
return
self.owned = False
self.do_owner_changed()

def do_owner_changed(self):
log("do_owner_changed()")
if not self._enabled:
return
self.target_data = {}
self.targets = ()

Expand Down Expand Up @@ -523,6 +532,8 @@ def timeout_get_contents(self, target, request_id):

def do_property_notify(self, event):
log("do_property_notify(%s)", event)
if not self._enabled:
return
#ie: atom="PRIMARY-TARGETS", atom="PRIMARY-STRING"
parts = event.atom.split("-", 1)
assert len(parts)==2
Expand Down

0 comments on commit d36249f

Please sign in to comment.