summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSimon Rettberg2018-07-31 15:06:41 +0200
committerSimon Rettberg2018-07-31 15:06:41 +0200
commitc2e9c13b25804ee697bc50c7dfa5d0b810bfc5bf (patch)
treee85ff1a8aa4feb7983b7de537deae531237aed76 /src
parent[*] Convert old C-Style casts (diff)
downloadpvs2-c2e9c13b25804ee697bc50c7dfa5d0b810bfc5bf.tar.gz
pvs2-c2e9c13b25804ee697bc50c7dfa5d0b810bfc5bf.tar.xz
pvs2-c2e9c13b25804ee697bc50c7dfa5d0b810bfc5bf.zip
[SERVER] Fix locking when locked unicast is current mode
Streaming source wasn't locked properly before
Diffstat (limited to 'src')
-rw-r--r--src/client/util/platform/blankscreen.cpp5
-rw-r--r--src/server/mainwindow/mainwindow.cpp14
-rw-r--r--src/server/net/client.cpp3
3 files changed, 14 insertions, 8 deletions
diff --git a/src/client/util/platform/blankscreen.cpp b/src/client/util/platform/blankscreen.cpp
index bf34614..5f9b04b 100644
--- a/src/client/util/platform/blankscreen.cpp
+++ b/src/client/util/platform/blankscreen.cpp
@@ -56,8 +56,9 @@ bool BlankScreen::lock(const QString& message)
this->raise();
// grabbing of keyboard and mouse
- XGrabKeyboard(_sysdep->dpy, DefaultRootWindow(_sysdep->dpy) , false, GrabModeAsync, GrabModeAsync, CurrentTime);
- XGrabPointer(_sysdep->dpy, DefaultRootWindow(_sysdep->dpy) , false, 0, GrabModeAsync, GrabModeAsync, None, 0, CurrentTime);
+#
+ XGrabKeyboard(_sysdep->dpy, DefaultRootWindow(_sysdep->dpy), false, GrabModeAsync, GrabModeAsync, CurrentTime);
+ XGrabPointer(_sysdep->dpy, DefaultRootWindow(_sysdep->dpy), false, 0, GrabModeAsync, GrabModeAsync, None, 0, CurrentTime);
QProcess ungrabP;
diff --git a/src/server/mainwindow/mainwindow.cpp b/src/server/mainwindow/mainwindow.cpp
index 73fcbaf..62e15d2 100644
--- a/src/server/mainwindow/mainwindow.cpp
+++ b/src/server/mainwindow/mainwindow.cpp
@@ -599,16 +599,19 @@ void MainWindow::reset(bool lock)
{
_mode = Mode::None;
+ // Stop server (Clients get stopped on ACK)
+ if (getClientFromId(_streamingSource) != nullptr) {
+ getClientFromId(_streamingSource)->stopVncServer();
+ }
+
// Unlock all clients
- for (QList<ConnectionFrame*>::iterator it(_clientFrames.begin()); it != _clientFrames.end(); ++it)
+ for (QList<ConnectionFrame*>::iterator it(_clientFrames.begin()); it != _clientFrames.end(); ++it) {
if ((*it)->client() != nullptr) {
(*it)->client()->lockScreen(lock);
(*it)->client()->removeAttention();
}
+ }
- // Stop server (Clients get stopped on ACK)
- if (getClientFromId(_streamingSource) != nullptr)
- getClientFromId(_streamingSource)->stopVncServer();
}
/*
@@ -1219,7 +1222,8 @@ void MainWindow::onVncServerStateChange(Client* client)
}
}
// Dont forget to unlock the vnc server (if necesarry)
- client->lockScreen(client->desiredProjectionSource() == NO_SOURCE && _mode == Mode::LockedUnicast);
+ client->lockScreen((client->desiredProjectionSource() == NO_SOURCE && _mode == Mode::LockedUnicast)
+ || ui->action_Lock->isChecked());
// If this was the current source remember that there is no source anymore and reset mode
if (client == getClientFromId(_streamingSource)) {
diff --git a/src/server/net/client.cpp b/src/server/net/client.cpp
index 9b2101f..3920ef7 100644
--- a/src/server/net/client.cpp
+++ b/src/server/net/client.cpp
@@ -22,7 +22,7 @@ Client::Client(QTcpSocket* socket) : _socket(socket)
assert(socket != nullptr);
_authed = 0;
_projectionSource = 0;
- _desiredSource = 0;
+ _desiredSource = NO_SOURCE;
_isActiveVncClient = false;
_vncPort = 0;
_isTutor = false;
@@ -305,6 +305,7 @@ void Client::stopVncClient()
msg.setField(_ID, _VNCCLIENT);
sendMessage(msg);
}
+ _desiredSource = NO_SOURCE;
}
/***************************************************************************//**