diff options
author | Samuel Mannehed <samuel@cendio.se> | 2024-10-02 10:18:22 +0200 |
---|---|---|
committer | Samuel Mannehed <samuel@cendio.se> | 2024-10-02 10:18:22 +0200 |
commit | 6f6d9406035d59b6a9f59ff0f38206c0c98a0266 (patch) | |
tree | 868fb314edb6f70014a3241be64b4a4ee5ff2aca | |
parent | 2f53c28180c4b8f5b4f6c84d3e7cad5f87912b09 (diff) | |
download | tigervnc-6f6d9406035d59b6a9f59ff0f38206c0c98a0266.tar.gz tigervnc-6f6d9406035d59b6a9f59ff0f38206c0c98a0266.zip |
Clear clipboard state when its not plain text
Commit 8a80c906b9f7c08b1c664569a97d327d62c6d8ae added a check to prevent
announcing clipboard when it's not plain text data. When this check
triggers and we want to ignore the non-plain text clipboard, we should
reset the state by no longer indicating pending clipboard, and by asking
the server to clear its clipboard. This ensures we don't end up in a
state where the server thinks the viewer has useful clipboard data, but
it doesn't.
-rw-r--r-- | vncviewer/Viewport.cxx | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/vncviewer/Viewport.cxx b/vncviewer/Viewport.cxx index fb6d4322..e29c877c 100644 --- a/vncviewer/Viewport.cxx +++ b/vncviewer/Viewport.cxx @@ -756,6 +756,9 @@ void Viewport::handleClipboardChange(int source, void *data) if (!Fl::clipboard_contains(Fl::clipboard_plain_text)) { vlog.debug("Got non-plain text in local clipboard, ignoring."); + // Reset the state as if we don't have any clipboard data at all + self->pendingClientClipboard = false; + self->cc->announceClipboard(false); return; } |