diff options
author | Pierre Ossman <ossman@cendio.se> | 2021-01-05 10:25:17 +0100 |
---|---|---|
committer | Pierre Ossman <ossman@cendio.se> | 2021-01-05 10:25:17 +0100 |
commit | 513cb8bc9414d8132bd9fd51b0713e17a6c3c4a2 (patch) | |
tree | 85779293af757ec564369f25f89a559ee1f51eba | |
parent | b89261358261522eb9696c87ad4d841878d17070 (diff) | |
download | tigervnc-513cb8bc9414d8132bd9fd51b0713e17a6c3c4a2.tar.gz tigervnc-513cb8bc9414d8132bd9fd51b0713e17a6c3c4a2.zip |
Fix clipboard state tracking in server
This was out of sync with the client handling for no good reason.
-rw-r--r-- | common/rfb/SConnection.cxx | 9 |
1 files changed, 7 insertions, 2 deletions
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); } |