diff options
author | Fabian Schillinger | 2010-11-05 02:10:04 +0100 |
---|---|---|
committer | Fabian Schillinger | 2010-11-05 02:10:04 +0100 |
commit | c850c907ff61bf4798bdb4fa59f4679f9ba1287a (patch) | |
tree | 61aa14589cbec54eaf14b4b9f8e9100da28af9e8 /src/pvs.cpp | |
parent | Process start/stop/view functionality (diff) | |
parent | Merge remote branch 'origin/master' (diff) | |
download | pvs-c850c907ff61bf4798bdb4fa59f4679f9ba1287a.tar.gz pvs-c850c907ff61bf4798bdb4fa59f4679f9ba1287a.tar.xz pvs-c850c907ff61bf4798bdb4fa59f4679f9ba1287a.zip |
Merge branch 'master' of openslx.org:pvs
Conflicts:
src/gui/mainWindow.cpp
Diffstat (limited to 'src/pvs.cpp')
-rwxr-xr-x | src/pvs.cpp | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/src/pvs.cpp b/src/pvs.cpp index 5469eaa..18b3570 100755 --- a/src/pvs.cpp +++ b/src/pvs.cpp @@ -20,7 +20,7 @@ #include "src/net/pvsServiceDiscovery.h" #include "src/net/pvsDiscoveredServer.h" #include "src/input/inputEvent.h" -#include "src/input/inputHandlerChain.h" +#include "src/input/inputHandlerChains.h" #include "src/input/x11InputUtils.h" #include "src/net/mcast/McastConfiguration.h" #include "src/net/pvsOutgoingMulticastTransfer.h" @@ -199,8 +199,11 @@ void PVS::onCommand(PVSMsg cmdMessage) if (ident.compare("INPUTEVENT") == 0) { InputEvent evt; - eventFromString(message, evt); - handleInputEvent(evt); + if(inputEventsAllowed()) + { + eventFromString(message, evt); + handleInputEvent(evt); + } } if (ident.compare("MCASTFTRETRY") == 0) { @@ -758,16 +761,23 @@ bool PVS::createMulticastTransfer(QString const& objectPath, quint64& transferID // Input handling +bool PVS::inputEventsAllowed() +{ + QString lecturer = getConfigValue("Permissions/vnc_lecturer"); + return lecturer == "rw"; +} + void PVS::handleInputEvent(InputEvent const& evt) { - std::string s = evt.toString(); - ConsoleLog writeLine(QString("Received input event: %1").arg(s.c_str())); + QString s = evt.toString(); + ConsoleLog writeLine(QString("Received input event: %1").arg(s.toLocal8Bit().constData())); _inputEventHandlers.handle(evt); } void PVS::initializeInputEventHandling() { X11InputUtils::setDisplay(X11Info::display()); + _inputEventHandlers = makeUnprivilegedInputEventHandlerChain(); _inputEventHandlers.initialize(); } |