summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorManuel Schneider2014-07-22 16:05:47 +0200
committerManuel Schneider2014-07-22 16:05:47 +0200
commit7fdffc46c2330195070fdf87bd43e4bab9fa3d59 (patch)
tree851f5fad23246c263c1c1cef7d9f533de0f7cfa9
parentDrop the watchers concept, since the desiredProjectionSource essentially impl... (diff)
downloadpvs2-7fdffc46c2330195070fdf87bd43e4bab9fa3d59.tar.gz
pvs2-7fdffc46c2330195070fdf87bd43e4bab9fa3d59.tar.xz
pvs2-7fdffc46c2330195070fdf87bd43e4bab9fa3d59.zip
Fix oneclick-source-change-lock-bug
-rw-r--r--TODO9
-rw-r--r--src/server/mainwindow/mainwindow.cpp52
-rw-r--r--src/server/net/client.cpp1
3 files changed, 27 insertions, 35 deletions
diff --git a/TODO b/TODO
index 897c470..df05c5f 100644
--- a/TODO
+++ b/TODO
@@ -1,3 +1,12 @@
+[ ] ConnectionFrame -> ComputerID ist schwachsinn. Wirklich sinnvoll wären
+'int IDs' welche dann auch die 1 Million (*it)->client->id() zu (*it)->id()
+vereinfache würden. zusätzlich kommtman villeicht irgendwann mal an den fleck an
+dem man die client pointer nicht mehr anfassen muss.
+
+
+--------------------------------------------------------------------------------
+[x] Locks funtionieren immer noch nicht richtig beim source wechsel
+
[ ] ein Client ist direkt nach dem Einloggen gesperrt <wenn zuvor die Funktion
"client auf Dozi-PC projiziert und alle anderen clients schwarz>
diff --git a/src/server/mainwindow/mainwindow.cpp b/src/server/mainwindow/mainwindow.cpp
index 1425640..7c484bb 100644
--- a/src/server/mainwindow/mainwindow.cpp
+++ b/src/server/mainwindow/mainwindow.cpp
@@ -312,18 +312,16 @@ void MainWindow::savePosition(ConnectionFrame *cf)
void MainWindow::tellClientCurrentSituation(Client* client)
{
// If clients are currently locked, tell this new client
- if (ui->action_Lock->isChecked())
+ if (ui->action_Lock->isChecked() || _mode == Mode::LockedUnicast)
client->lockScreen(true);
if (_mode == Mode::Broadcast){
client->setDesiredProjectionSource(_streamingSource);
- Client* c = getClientFromId(_streamingSource);
- if (c != NULL) {
- client->startVncClient(c);
+ if (_streamingSource != 0) {
+ client->startVncClient(getClientFromId(_streamingSource));
}
}
- else if (_mode == Mode::LockedUnicast)
- client->lockScreen(true);
+
}
@@ -1054,37 +1052,16 @@ void MainWindow::onVncServerStateChange(Client* client)
if (client->isActiveVncServer())
{
-// if (_mode == Mode::Broadcast)
-// {
-// for (QList<ConnectionFrame*>::iterator it(_clientFrames.begin()); it != _clientFrames.end(); ++it)
-// {
-// if ((*it)->client() != NULL)
-// {
-// // Unlock all online clients
-// (*it)->client()->lockScreen(false);
-
-// // Start VNCclients on all online clients but source
-// if ((*it)->client() != client)
-// (*it)->client()->startVncClient(client);
-// }
-// }
-// }
-// else
- {
- // apply the desired projection sources
- for (QList<ConnectionFrame*>::iterator it(_clientFrames.begin()); it != _clientFrames.end(); ++it)
+ // apply the desired projection sources
+ for (QList<ConnectionFrame*>::iterator it(_clientFrames.begin()); it != _clientFrames.end(); ++it)
+ if ( (*it)->client() != NULL) // Ignore offline clients
{
- // Ignore offline clients
- if ( (*it)->client() != NULL)
- {
- qDebug() << "ID" <<(*it)->client()->id() << "ds" << (*it)->client()->desiredProjectionSource() <<"ps"<< (*it)->client()->projectionSource();
- if ( (*it)->client()->desiredProjectionSource() == client->id() )
- (*it)->client()->startVncClient(client);
-
- (*it)->client()->lockScreen((*it)->client()->desiredProjectionSource() == NO_SOURCE && _mode == Mode::LockedUnicast);
- }
+ if ( (*it)->client()->desiredProjectionSource() == client->id() )
+ (*it)->client()->startVncClient(client);
+ (*it)->client()->lockScreen((*it)->client()->desiredProjectionSource() == NO_SOURCE && _mode == Mode::LockedUnicast);
}
- }
+ // Dont forget to unlock the vnc server
+ client->lockScreen(false);
}
else
{
@@ -1101,6 +1078,11 @@ void MainWindow::onVncServerStateChange(Client* client)
}
}
}
+ // If this was the current source remember that there is no source anymore
+ if (client == getClientFromId(_streamingSource))
+ _streamingSource = NO_SOURCE;
+ // Dont forget to unlock the vnc server (if necesarry)
+ client->lockScreen(client->desiredProjectionSource() == NO_SOURCE && _mode == Mode::LockedUnicast);
}
}
diff --git a/src/server/net/client.cpp b/src/server/net/client.cpp
index a00ef88..f575196 100644
--- a/src/server/net/client.cpp
+++ b/src/server/net/client.cpp
@@ -22,6 +22,7 @@ Client::Client(QSslSocket* socket) : _socket(socket)
assert(socket != NULL);
_authed = 0;
_projectionSource = 0;
+ _desiredSource = 0;
_isActiveVncClient = false;
_vncPort = 0;
_isTutor = false;