From a17779e7fdce5a4f7d81d0e1b397ab361167327f Mon Sep 17 00:00:00 2001 From: Xinyu Hou Date: Fri, 16 Sep 2016 09:24:46 -0400 Subject: [PATCH] #123 Disabled clipboard grab mechanism when clipboard is disabled --- src/lib/client/Client.cpp | 4 ++++ src/lib/server/Server.cpp | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/src/lib/client/Client.cpp b/src/lib/client/Client.cpp index 591b4cab..748c8cb7 100644 --- a/src/lib/client/Client.cpp +++ b/src/lib/client/Client.cpp @@ -672,6 +672,10 @@ Client::handleShapeChanged(const Event&, void*) void Client::handleClipboardGrabbed(const Event& event, void*) { + if (!m_enableClipboard) { + return; + } + const IScreen::ClipboardInfo* info = reinterpret_cast(event.getData()); diff --git a/src/lib/server/Server.cpp b/src/lib/server/Server.cpp index af958889..b0ff56fc 100644 --- a/src/lib/server/Server.cpp +++ b/src/lib/server/Server.cpp @@ -1219,6 +1219,10 @@ Server::handleShapeChanged(const Event&, void* vclient) void Server::handleClipboardGrabbed(const Event& event, void* vclient) { + if (!m_enableClipboard) { + return; + } + // ignore events from unknown clients BaseClientProxy* grabber = reinterpret_cast(vclient); if (m_clientSet.count(grabber) == 0) {