diff options
author | Simon Rettberg | 2018-08-02 16:30:09 +0200 |
---|---|---|
committer | Simon Rettberg | 2018-08-02 16:30:09 +0200 |
commit | 7e30e24934b5f7d21cbb0ada865bd3fc1b011ab4 (patch) | |
tree | 3f6ab3857f0ce8d4c7a8a63f45151488e4188b79 /src/server | |
parent | Remove ugly comment separator lines above functions (diff) | |
download | pvs2-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
Diffstat (limited to 'src/server')
-rw-r--r-- | src/server/mainwindow/mainwindow.cpp | 11 | ||||
-rw-r--r-- | src/server/net/client.cpp | 2 |
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); |