From: Pierre Ossman Date: Tue, 5 Jan 2021 09:25:17 +0000 (+0100) Subject: Fix clipboard state tracking in server X-Git-Tag: v1.11.90~69^2~2 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=513cb8bc9414d8132bd9fd51b0713e17a6c3c4a2;p=tigervnc.git Fix clipboard state tracking in server This was out of sync with the client handling for no good reason. --- diff --git a/common/rfb/SConnection.cxx b/common/rfb/SConnection.cxx index b4f63ae8..d44ff786 100644 --- a/common/rfb/SConnection.cxx +++ b/common/rfb/SConnection.cxx @@ -315,6 +315,8 @@ void SConnection::setEncodings(int nEncodings, const rdr::S32* encodings) void SConnection::clientCutText(const char* str) { + hasLocalClipboard = false; + strFree(clientClipboard); clientClipboard = NULL; @@ -343,10 +345,12 @@ void SConnection::handleClipboardNotify(rdr::U32 flags) strFree(clientClipboard); clientClipboard = NULL; - if (flags & rfb::clipboardUTF8) + if (flags & rfb::clipboardUTF8) { + hasLocalClipboard = false; handleClipboardAnnounce(true); - else + } else { handleClipboardAnnounce(false); + } } void SConnection::handleClipboardProvide(rdr::U32 flags, @@ -361,6 +365,7 @@ void SConnection::handleClipboardProvide(rdr::U32 flags, clientClipboard = convertLF((const char*)data[0], lengths[0]); + // FIXME: Should probably verify that this data was actually requested handleClipboardData(clientClipboard); }