summaryrefslogtreecommitdiffstats
path: root/src/server/mainwindow/mainwindow.cpp
diff options
context:
space:
mode:
authorManuel Schneider2014-07-22 16:05:47 +0200
committerManuel Schneider2014-07-22 16:05:47 +0200
commit7fdffc46c2330195070fdf87bd43e4bab9fa3d59 (patch)
tree851f5fad23246c263c1c1cef7d9f533de0f7cfa9 /src/server/mainwindow/mainwindow.cpp
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
Diffstat (limited to 'src/server/mainwindow/mainwindow.cpp')
-rw-r--r--src/server/mainwindow/mainwindow.cpp52
1 files changed, 17 insertions, 35 deletions
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);
}
}