From: Samuel Mannehed Date: Wed, 2 Oct 2024 08:18:22 +0000 (+0200) Subject: Clear clipboard state when its not plain text X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=6f6d9406035d59b6a9f59ff0f38206c0c98a0266;p=tigervnc.git 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. --- 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; }