aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSamuel Mannehed <samuel@cendio.se>2024-10-02 10:18:22 +0200
committerLinn Mattsson <linma@cendio.se>2024-10-22 12:41:34 +0200
commitcf1f5380f9ea099ce42b144e0552541fc08946a7 (patch)
tree7c9fe1c6cac0a2c01a6366d6187d36b5169fa5d7
parentfa26b74fb5f4653f71741bd7c1230acf992ef6f7 (diff)
downloadtigervnc-cf1f5380f9ea099ce42b144e0552541fc08946a7.tar.gz
tigervnc-cf1f5380f9ea099ce42b144e0552541fc08946a7.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. (cherry picked from commit 6f6d9406035d59b6a9f59ff0f38206c0c98a0266)
-rw-r--r--vncviewer/Viewport.cxx3
1 files changed, 3 insertions, 0 deletions
diff --git a/vncviewer/Viewport.cxx b/vncviewer/Viewport.cxx
index 5ff38f68..e3c3f87d 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;
}