diff options
author | Sebastien Braun | 2010-11-04 00:38:24 +0100 |
---|---|---|
committer | Sebastien Braun | 2010-11-04 00:38:24 +0100 |
commit | 4fcc0efae9738bb28922da592fff78cfef50277b (patch) | |
tree | b3855b36abe874606a802ec75fc573543d2d7b35 /src/pvs.cpp | |
parent | [PVSMGRTOUCH] resetall bug fixed (diff) | |
parent | Documentation fixes and code cleanup (diff) | |
download | pvs-4fcc0efae9738bb28922da592fff78cfef50277b.tar.gz pvs-4fcc0efae9738bb28922da592fff78cfef50277b.tar.xz pvs-4fcc0efae9738bb28922da592fff78cfef50277b.zip |
Merge input handling work to master
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 bda16f8..755eea5 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) { @@ -755,16 +758,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(); } |