From 54c3e592d28fb3ce59856167568650e13d3f5333 Mon Sep 17 00:00:00 2001 From: Jan Grulich Date: Thu, 6 Aug 2026 11:00:06 +0200 Subject: [PATCH] vncviewer: fix clipboard check incorrectly rejecting PRIMARY selections Resolves: RHEL-192138 --- ...orrectly-rejecting-primary-selection.patch | 29 +++++++++++++++++++ tigervnc.spec | 9 +++++- 2 files changed, 37 insertions(+), 1 deletion(-) create mode 100644 tigervnc-vncviewer-fix-clipboard-check-incorrectly-rejecting-primary-selection.patch diff --git a/tigervnc-vncviewer-fix-clipboard-check-incorrectly-rejecting-primary-selection.patch b/tigervnc-vncviewer-fix-clipboard-check-incorrectly-rejecting-primary-selection.patch new file mode 100644 index 0000000..5ef3cdd --- /dev/null +++ b/tigervnc-vncviewer-fix-clipboard-check-incorrectly-rejecting-primary-selection.patch @@ -0,0 +1,29 @@ +From 763c9d1a80b0333cc248d78e135309013dd68f9f Mon Sep 17 00:00:00 2001 +From: Jan Grulich +Date: Fri, 31 Jul 2026 13:42:48 +0200 +Subject: [PATCH] vncviewer: fix clipboard check incorrectly rejecting PRIMARY + selections + +Fl::clipboard_contains() doesn't query PRIMARY selection. When text is +selected, the clipboard notify is sent with source=0 (PRIMARY), but the +check performed by Fl::clipboard_contains() might be checking clipboard +which may be empty, causing a false "Got non-plain text" rejection. + +Fixes #2129 +--- + vncviewer/Viewport.cxx | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/vncviewer/Viewport.cxx b/vncviewer/Viewport.cxx +index 251b5ece5a..c3919f4d06 100644 +--- a/vncviewer/Viewport.cxx ++++ b/vncviewer/Viewport.cxx +@@ -595,7 +595,7 @@ void Viewport::handleClipboardChange(int source, void *data) + return; + #endif + +- if (!Fl::clipboard_contains(Fl::clipboard_plain_text)) { ++ if (source != 0 && !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; diff --git a/tigervnc.spec b/tigervnc.spec index 018497a..d74d92b 100644 --- a/tigervnc.spec +++ b/tigervnc.spec @@ -5,7 +5,7 @@ Name: tigervnc Version: 1.16.2 -Release: 3%{?dist} +Release: 4%{?dist} Summary: A TigerVNC remote display system %global _hardened_build 1 @@ -31,6 +31,8 @@ Patch3: tigervnc-add-option-allowing-to-connect-only-user-owning-session Patch4: tigervnc-allow-use-of-passwords-longer-than-eight-characters.patch # Upstream patches +# https://github.com/TigerVNC/tigervnc/pull/2135 +Patch10: tigervnc-vncviewer-fix-clipboard-check-incorrectly-rejecting-primary-selection.patch # Upstreamable patches @@ -209,6 +211,7 @@ popd %patch -P4 -p1 -b .allow-use-of-passwords-longer-than-eight-characters # Upstream patches +%patch -P10 -p1 -b .vncviewer-fix-clipboard-check-incorrectly-rejecting-primary-selection # Upstreamable patches @@ -388,6 +391,10 @@ fi %ghost %verify(not md5 size mode mtime) %{_sharedstatedir}/selinux/%{selinuxtype}/active/modules/200/%{modulename} %changelog +* Thu Aug 06 2026 Jan Grulich - 1.16.2-4 +- vncviewer: fix clipboard check incorrectly rejecting PRIMARY selections + Resolves: RHEL-192138 + * Thu Jun 25 2026 Jan Grulich - 1.16.2-3 - Rebuild for updated xorg-x11-server Resolves: RHEL-184004