From: Samuel Mannehed Date: Tue, 1 Oct 2024 10:49:40 +0000 (+0200) Subject: Only announce clipboard for plain text data X-Git-Tag: v1.14.1~3 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=fa26b74fb5f4653f71741bd7c1230acf992ef6f7;p=tigervnc.git Only announce clipboard for plain text data FLTK has support for both image and plain text clipboard data, we don't. This means we only send plain text clipboard from the viewer to the server. Some applications can get confused when we announce that clipboard is available and later don't send anything. An example of such an application is QGIS, in the remote session it froze when an image was copied on the client side. This fix means we only call announceClipboard() when the clipboard contains plain text. That means TigerVNC is now more robust and doesn't trigger freezes in buggy applications. (cherry picked from commit 8a80c906b9f7c08b1c664569a97d327d62c6d8ae) --- diff --git a/vncviewer/Viewport.cxx b/vncviewer/Viewport.cxx index be2cbc8f..5ff38f68 100644 --- a/vncviewer/Viewport.cxx +++ b/vncviewer/Viewport.cxx @@ -754,6 +754,11 @@ void Viewport::handleClipboardChange(int source, void *data) return; #endif + if (!Fl::clipboard_contains(Fl::clipboard_plain_text)) { + vlog.debug("Got non-plain text in local clipboard, ignoring."); + return; + } + self->clipboardSource = source; if (!self->hasFocus()) {