diff options
author | Slávek Banko <[email protected]> | 2021-03-23 12:49:26 +0100 |
---|---|---|
committer | Slávek Banko <[email protected]> | 2021-03-23 12:52:45 +0100 |
commit | 5829099f44f684ff3775664e6482e148a4f9815a (patch) | |
tree | e680af12b6a3d43d7cdbac8199518b4c9bcaea63 | |
parent | fbe1a828bda459f61077f4db13dfb855fde7fc4f (diff) | |
download | tdenetwork-5829099f44f684ff3775664e6482e148a4f9815a.tar.gz tdenetwork-5829099f44f684ff3775664e6482e148a4f9815a.zip |
krdc: Do not synchronize the contents of the clipboard in view only mode.
This fixes an incomplete solution from commit 9598af1608.
Signed-off-by: Slávek Banko <[email protected]>
(cherry picked from commit 5fe4e2d08b99d15adbdc4d0a586061351a4d814b)
-rw-r--r-- | krdc/vnc/kvncview.cpp | 27 |
1 files changed, 19 insertions, 8 deletions
diff --git a/krdc/vnc/kvncview.cpp b/krdc/vnc/kvncview.cpp index 22960423..b29cd588 100644 --- a/krdc/vnc/kvncview.cpp +++ b/krdc/vnc/kvncview.cpp @@ -338,8 +338,6 @@ TQSize KVncView::framebufferSize() { void KVncView::setViewOnly(bool s) { m_viewOnly = s; - m_dontSendCb = s; - if (s) setCursor(TQt::ArrowCursor); else @@ -513,12 +511,15 @@ void KVncView::customEvent(TQCustomEvent *e) TQApplication::beep(); } else if (e->type() == ServerCutEventType) { - ServerCutEvent *sce = (ServerCutEvent*) e; - TQString ctext = TQString::fromUtf8(sce->bytes(), sce->length()); - m_dontSendCb = true; - m_cb->setText(ctext, TQClipboard::Clipboard); - m_cb->setText(ctext, TQClipboard::Selection); - m_dontSendCb = false; + if (!m_viewOnly) + { + ServerCutEvent *sce = (ServerCutEvent*) e; + TQString ctext = TQString::fromUtf8(sce->bytes(), sce->length()); + m_dontSendCb = true; + m_cb->setText(ctext, TQClipboard::Clipboard); + m_cb->setText(ctext, TQClipboard::Selection); + m_dontSendCb = false; + } } else if (e->type() == MouseStateEventType) { MouseStateEvent *mse = (MouseStateEvent*) e; @@ -706,6 +707,11 @@ void KVncView::clipboardChanged() { if (m_status != REMOTE_VIEW_CONNECTED) return; + if (m_viewOnly) + { + return; + } + if (m_cb->ownsClipboard() || m_dontSendCb) return; @@ -720,6 +726,11 @@ void KVncView::selectionChanged() { if (m_status != REMOTE_VIEW_CONNECTED) return; + if (m_viewOnly) + { + return; + } + if (m_cb->ownsSelection() || m_dontSendCb) return; |