summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon Rettberg2018-08-02 16:30:09 +0200
committerSimon Rettberg2018-08-02 16:30:09 +0200
commit7e30e24934b5f7d21cbb0ada865bd3fc1b011ab4 (patch)
tree3f6ab3857f0ce8d4c7a8a63f45151488e4188b79
parentRemove ugly comment separator lines above functions (diff)
downloadpvs2-7e30e24934b5f7d21cbb0ada865bd3fc1b011ab4.tar.gz
pvs2-7e30e24934b5f7d21cbb0ada865bd3fc1b011ab4.tar.xz
pvs2-7e30e24934b5f7d21cbb0ada865bd3fc1b011ab4.zip
[server] Fix current VNC projection source check, fix button enable
* streaming from/to tutor was enabled even if selected client was offline * VNC client start command was swallowed even if no projection was running (just matched the last projection source) * Screen wasn't unlocked again when switching from LockedUnicast to Unicast
-rw-r--r--src/server/mainwindow/mainwindow.cpp11
-rw-r--r--src/server/net/client.cpp2
2 files changed, 6 insertions, 7 deletions
diff --git a/src/server/mainwindow/mainwindow.cpp b/src/server/mainwindow/mainwindow.cpp
index f59d040..e50efa7 100644
--- a/src/server/mainwindow/mainwindow.cpp
+++ b/src/server/mainwindow/mainwindow.cpp
@@ -546,9 +546,9 @@ void MainWindow::updateContextButtonStates()
ui->action_SetAsTutor->setEnabled(somethingSelected);
ui->action_LockSingle->setEnabled(selectedOnline && selected != tutor);
// Don't allow projection to self
- ui->action_StudentToTutorExclusive->setEnabled(somethingSelected && selected != tutor && tutorOnline);
- ui->action_StudentToTutor->setEnabled(somethingSelected && selected != tutor && tutorOnline);
- ui->action_TutorToStudent->setEnabled(somethingSelected && selected != tutor && tutorOnline);
+ ui->action_StudentToTutorExclusive->setEnabled(selectedOnline && tutorOnline && selected != tutor);
+ ui->action_StudentToTutor->setEnabled(selectedOnline && tutorOnline && selected != tutor);
+ ui->action_TutorToStudent->setEnabled(selectedOnline && tutorOnline && selected != tutor);
// Only allow tutor broadcast if they're online
ui->action_TutorToAll->setEnabled(tutorOnline);
}
@@ -1175,9 +1175,8 @@ void MainWindow::onVncServerStateChange(Client* client)
if (frame->client()->desiredProjectionSource() == client->id()) {
frame->client()->startVncClient(client);
client->lockScreen(false);
- }
- if (frame->client()->desiredProjectionSource() == NO_SOURCE && _mode == Mode::LockedUnicast) {
- frame->client()->lockScreen(true);
+ } else {
+ frame->client()->lockScreen(frame->client()->desiredProjectionSource() == NO_SOURCE && _mode == Mode::LockedUnicast);
}
}
// Dont forget to unlock the vnc server
diff --git a/src/server/net/client.cpp b/src/server/net/client.cpp
index e11a3e7..977eb84 100644
--- a/src/server/net/client.cpp
+++ b/src/server/net/client.cpp
@@ -273,7 +273,7 @@ void Client::stopVncServer()
void Client::startVncClient(const Client * const to)
{
- if (_projectionSource == to->_id)
+ if (_isActiveVncClient && _projectionSource == to->_id)
return; // Already watching given target, do nothing
NetworkMessage msg;
msg.setField(_ID, _VNCCLIENT);