summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon Rettberg2017-02-10 15:41:10 +0100
committerSimon Rettberg2017-02-10 15:41:10 +0100
commit9c1b3e72ad664d145fd5802da5a7432b788d0814 (patch)
tree141f823abc68617ec267587ce122163c994d2f5d
parent[sample_configuration] kb-lock: Disable mouse too (diff)
downloadpvs2-9c1b3e72ad664d145fd5802da5a7432b788d0814.tar.gz
pvs2-9c1b3e72ad664d145fd5802da5a7432b788d0814.tar.xz
pvs2-9c1b3e72ad664d145fd5802da5a7432b788d0814.zip
[client] Periodically bring vnc and lock window to top
-rw-r--r--src/client/util/platform/blankscreen.h3
-rw-r--r--src/client/util/platform/blankscreen_X11.cpp12
-rw-r--r--src/client/vnc/vncwindow.cpp14
-rw-r--r--src/client/vnc/vncwindow.h1
4 files changed, 29 insertions, 1 deletions
diff --git a/src/client/util/platform/blankscreen.h b/src/client/util/platform/blankscreen.h
index 24c4969..8d8c9de 100644
--- a/src/client/util/platform/blankscreen.h
+++ b/src/client/util/platform/blankscreen.h
@@ -21,6 +21,9 @@ private:
bool _locked;
QString _message;
BlankScreen_Sysdep* _sysdep;
+
+private slots:
+ void timer_moveToTop();
};
#endif
diff --git a/src/client/util/platform/blankscreen_X11.cpp b/src/client/util/platform/blankscreen_X11.cpp
index 1f36f89..ee644ca 100644
--- a/src/client/util/platform/blankscreen_X11.cpp
+++ b/src/client/util/platform/blankscreen_X11.cpp
@@ -4,6 +4,7 @@
#include <QApplication>
#include <QProcess>
#include <QDesktopWidget>
+#include <QTimer>
#include <X11/Xlib.h>
#include <X11/cursorfont.h>
@@ -26,6 +27,9 @@ BlankScreen::BlankScreen() : QDialog(NULL)
setStyleSheet("background-color:#000");
_locked = false;
+ QTimer *upper = new QTimer(this);
+ connect(upper, SIGNAL(timeout()), this, SLOT(timer_moveToTop()));
+ upper->start(1111);
}
BlankScreen::~BlankScreen()
@@ -86,3 +90,11 @@ bool BlankScreen::unlock()
_locked = false;
return true;
}
+
+void BlankScreen::timer_moveToTop()
+{
+ if (this->isHidden())
+ return;
+ activateWindow();
+ raise();
+}
diff --git a/src/client/vnc/vncwindow.cpp b/src/client/vnc/vncwindow.cpp
index b7690b8..0854f01 100644
--- a/src/client/vnc/vncwindow.cpp
+++ b/src/client/vnc/vncwindow.cpp
@@ -19,10 +19,14 @@
#include "vncthread.h"
#include "../clientapp/clientapp.h"
+#include <QTimer>
+
VncWindow::VncWindow(QWidget *parent) :
QWidget(parent), _vncWorker(NULL), _viewOnly(true), _clientId(0), _redrawTimer(0), _tcpTimeoutTimer(0)
{
- //
+ QTimer *upper = new QTimer(this);
+ connect(upper, SIGNAL(timeout()), this, SLOT(timer_moveToTop()));
+ upper->start(1111);
}
VncWindow::~VncWindow()
@@ -193,6 +197,14 @@ void VncWindow::onProjectionStopped()
this->close();
}
+void VncWindow::timer_moveToTop()
+{
+ if (this->isHidden())
+ return;
+ activateWindow();
+ raise();
+}
+
////////////////////////////////////////////////////////////////////////////////
// Protected
/**
diff --git a/src/client/vnc/vncwindow.h b/src/client/vnc/vncwindow.h
index 2cb9ad0..29f2e98 100644
--- a/src/client/vnc/vncwindow.h
+++ b/src/client/vnc/vncwindow.h
@@ -31,6 +31,7 @@ protected slots:
void onUpdateImage(const int x, const int y, const int w, const int h);
void onProjectionStarted();
void onProjectionStopped();
+ void timer_moveToTop();
void open(const QString& host, int port, const QString& passwd, bool ro, bool fullscreen, const QString& caption, const int clientId, const QByteArray& rawThumb);
// bool close();