summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSlávek Banko <slavek.banko@axis.cz>2021-03-23 12:49:26 +0100
committerSlávek Banko <slavek.banko@axis.cz>2021-03-23 12:52:02 +0100
commit5fe4e2d08b99d15adbdc4d0a586061351a4d814b (patch)
tree6a34afe91eb87737270cbd4707a530ae9845f165
parenta97fac6c8944b1da34fcae9d8987caab04e9e5ad (diff)
downloadtdenetwork-5fe4e2d0.tar.gz
tdenetwork-5fe4e2d0.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 <slavek.banko@axis.cz>
-rw-r--r--krdc/vnc/kvncview.cpp27
1 files changed, 19 insertions, 8 deletions
diff --git a/krdc/vnc/kvncview.cpp b/krdc/vnc/kvncview.cpp
index d4f71cee..ea5e84f4 100644
--- a/krdc/vnc/kvncview.cpp
+++ b/krdc/vnc/kvncview.cpp
@@ -331,8 +331,6 @@ TQSize KVncView::framebufferSize() {
void KVncView::setViewOnly(bool s) {
m_viewOnly = s;
- m_dontSendCb = s;
-
if (s)
setCursor(TQt::ArrowCursor);
else
@@ -516,12 +514,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;
@@ -712,6 +713,11 @@ void KVncView::clipboardChanged() {
if (m_status != REMOTE_VIEW_CONNECTED)
return;
+ if (m_viewOnly)
+ {
+ return;
+ }
+
if (m_cb->ownsClipboard() || m_dontSendCb)
return;
@@ -726,6 +732,11 @@ void KVncView::selectionChanged() {
if (m_status != REMOTE_VIEW_CONNECTED)
return;
+ if (m_viewOnly)
+ {
+ return;
+ }
+
if (m_cb->ownsSelection() || m_dontSendCb)
return;