Skip to content

Commit

Permalink
Clear clipboard state when its not plain text
Browse files Browse the repository at this point in the history
Commit 8a80c90 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.
  • Loading branch information
samhed committed Oct 2, 2024
1 parent 2f53c28 commit 6f6d940
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions vncviewer/Viewport.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 6f6d940

Please sign in to comment.