xpra icon
Bug tracker and wiki

Ticket #834: hack-nativehtml-to-string.patch

File hack-nativehtml-to-string.patch, 1.1 KB (added by Antoine Martin, 5 years ago)

hardcoded patch to substitute the target string on the fly so we return a string

  • xpra/clipboard/clipboard_base.py

     
    4545        "^dyn\.")
    4646DISCARD_TARGETS = [re.compile(x) for x in _discard_target_strs_]
    4747
     48TRANSLATED_TARGETS = {"application/x-moz-nativehtml" : "UTF8_STRING"}
     49
    4850TEXT_TARGETS = ("UTF8_STRING", "TEXT", "STRING", "text/plain")
    4951
    5052
     
    162164        proxy.got_token(targets, target_data)
    163165
    164166    def _get_clipboard_from_remote_handler(self, proxy, selection, target):
     167        target = TRANSLATED_TARGETS.get(target, target)
    165168        for x in DISCARD_TARGETS:
    166169            if x.match(target):
    167170                log("invalid target '%s'", target)
     
    313316        request_id, selection, target = packet[1:4]
    314317        def no_contents():
    315318            self.send("clipboard-contents-none", request_id, selection)
     319        target = TRANSLATED_TARGETS.get(target, target)
    316320        for x in DISCARD_TARGETS:
    317321            if x.match(target):
    318322                log("invalid target '%s'", target)