Ejemplo n.º 1
0
 def clipboard_nesting_check(self, action, packet_type, ss):
     log("clipboard_nesting_check(%s, %s, %s)", action, packet_type, ss)
     cc = self._clipboard_client
     if cc is None:
         log("not %s clipboard packet '%s': no clipboard client", action,
             packet_type)
         return False
     if not cc.clipboard_enabled:
         log(
             "not %s clipboard packet '%s': client %s has clipboard disabled",
             action, packet_type, cc)
         return False
     from xpra.clipboard.clipboard_base import nesting_check
     if not nesting_check():
         #turn off clipboard at our end:
         self.set_clipboard_enabled_status(ss, False)
         #if we can, tell the client to do the same:
         if ss.clipboard_set_enabled:
             ss.send_clipboard_enabled("probable clipboard loop detected")
             body = "Too many clipboard requests,\n"+\
                    "a clipboard synchronization loop is likely to be causing this problem"
             ss.may_notify(XPRA_CLIPBOARD_NOTIFICATION_ID,
                           "Clipboard synchronization is now disabled",
                           body,
                           icon_name="clipboard")
         return False
     return True
Ejemplo n.º 2
0
 def process_clipboard_packet(self, packet):
     clipboardlog("process_clipboard_packet(%s) level=%s", packet,
                  gtk.main_level())
     #check for clipboard loops:
     from xpra.clipboard.clipboard_base import nesting_check
     if not nesting_check():
         self.clipboard_enabled = False
         self.emit("clipboard-toggled")
         return
     self.idle_add(self.clipboard_helper.process_clipboard_packet, packet)
Ejemplo n.º 3
0
 def clipboard_nesting_check(self, action, packet_type, ss):
     clipboardlog("clipboard_nesting_check(%s, %s, %s)", action, packet_type, ss)
     cc = self._clipboard_client
     if cc is None:
         clipboardlog("not %s clipboard packet '%s': no clipboard client", action, packet_type)
         return False
     if not cc.clipboard_enabled:
         clipboardlog("not %s clipboard packet '%s': client %s has clipboard disabled", action, packet_type, cc)
         return False
     from xpra.clipboard.clipboard_base import nesting_check
     if not nesting_check():
         #turn off clipboard at our end:
         self.set_clipboard_enabled_status(ss, False)
         #if we can, tell the client to do the same:
         if ss.clipboard_set_enabled:
             ss.send_clipboard_enabled("probable clipboard loop detected")
         return  False
     return True