From 7e30e24934b5f7d21cbb0ada865bd3fc1b011ab4 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Thu, 2 Aug 2018 16:30:09 +0200 Subject: [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 --- src/server/mainwindow/mainwindow.cpp | 11 +++++------ 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); -- cgit v1.2.3-55-g7522