diff --git a/src/lib/client/Client.cpp b/src/lib/client/Client.cpp index b67f64bf..f01044ea 100644 --- a/src/lib/client/Client.cpp +++ b/src/lib/client/Client.cpp @@ -73,7 +73,8 @@ Client::Client( m_writeToDropDirThread(NULL), m_socket(NULL), m_useSecureNetwork(false), - m_args(args) + m_args(args), + m_enableClipboard(true) { assert(m_socketFactory != NULL); assert(m_screen != NULL); @@ -264,10 +265,12 @@ Client::leave() m_screen->leave(); - // send clipboards that we own and that have changed - for (ClipboardID id = 0; id < kClipboardEnd; ++id) { - if (m_ownClipboard[id]) { - sendClipboard(id); + if (m_enableClipboard) { + // send clipboards that we own and that have changed + for (ClipboardID id = 0; id < kClipboardEnd; ++id) { + if (m_ownClipboard[id]) { + sendClipboard(id); + } } } @@ -360,6 +363,20 @@ Client::resetOptions() void Client::setOptions(const OptionsList& options) { + for (OptionsList::const_iterator index = options.cbegin(); + index != options.cend(); ++index) { + const OptionID id = *index; + if (id == kOptionClipboardSharing) { + index++; + if (*index == static_cast(false)) { + LOG((CLOG_NOTE "clipboard sharing is disabled")); + } + m_enableClipboard = *index; + + break; + } + } + m_screen->setOptions(options); } diff --git a/src/lib/client/Client.h b/src/lib/client/Client.h index b3668783..22740be0 100644 --- a/src/lib/client/Client.h +++ b/src/lib/client/Client.h @@ -223,4 +223,5 @@ private: TCPSocket* m_socket; bool m_useSecureNetwork; ClientArgs m_args; + bool m_enableClipboard; }; diff --git a/src/lib/client/ServerProxy.cpp b/src/lib/client/ServerProxy.cpp index fc84fd21..bf11dd38 100644 --- a/src/lib/client/ServerProxy.cpp +++ b/src/lib/client/ServerProxy.cpp @@ -833,9 +833,7 @@ ServerProxy::setOptions() // update keep alive setKeepAliveRate(1.0e-3 * static_cast(options[i + 1])); } - else if (options[i] == kOptionClipboardSharing) { - LOG((CLOG_DEBUG "disable clipboard sharing")); - } + if (id != kKeyModifierIDNull) { m_modifierTranslationTable[id] = static_cast(options[i + 1]);