diff options
| author | Manuel Schneider | 2014-04-29 20:39:09 +0200 |
|---|---|---|
| committer | Manuel Schneider | 2014-04-29 20:39:09 +0200 |
| commit | 03e3100c37fb9ce55ea63f74bec0b72acedf7ed0 (patch) | |
| tree | 162276a7b7ca0ec8fd64ebc9792a1024bc385cbe /src/client | |
| parent | Adding comments for each method in the .cpp files and class definition in the... (diff) | |
| download | pvs2-03e3100c37fb9ce55ea63f74bec0b72acedf7ed0.tar.gz pvs2-03e3100c37fb9ce55ea63f74bec0b72acedf7ed0.tar.xz pvs2-03e3100c37fb9ce55ea63f74bec0b72acedf7ed0.zip | |
Increased the timeout for debugging purposes; Instruct vncserver to trasmit just
the primary desktop; Thumbnails just display the primary dektop
Diffstat (limited to 'src/client')
| -rw-r--r-- | src/client/net/serverconnection.cpp | 18 | ||||
| -rw-r--r-- | src/client/toolbar/toolbar.cpp | 2 | ||||
| -rw-r--r-- | src/client/vnc/vncserver.cpp | 17 |
3 files changed, 33 insertions, 4 deletions
diff --git a/src/client/net/serverconnection.cpp b/src/client/net/serverconnection.cpp index 530701d..afc43aa 100644 --- a/src/client/net/serverconnection.cpp +++ b/src/client/net/serverconnection.cpp @@ -34,9 +34,9 @@ ServerConnection::ServerConnection(const QString& host, const quint16 port, cons ); qDebug("Connecting to %s on port %d", host.toUtf8().data(), (int)port); _socket->connectToHostEncrypted(host, port); - _timerId = startTimer(4000); + _timerId = startTimer(600000);// TODO(manuel): Debuging purposes _lastData = QDateTime::currentMSecsSinceEpoch() + PING_TIMEOUT_MS; - _timerConnectionCheck = startTimer(5000); + _timerConnectionCheck = startTimer(600000);// TODO(manuel): Debuging purposes // Connect the vnc start/stop signal to this class, so we can tell the server about successful vnc server startup connect(VncServer::instance(), SIGNAL(started(int, QString&, QString&)), this, SLOT(onVncServerStartStop(int, QString&, QString&))); } @@ -189,7 +189,19 @@ void ServerConnection::handleMsg() y = 18; else if (y > 300) y = 300; - QPixmap desktop(QPixmap::grabWindow(QApplication::desktop()->winId()).scaled( + + // Get rect of primary screen + int primary = QApplication::desktop()->primaryScreen(); + QRect primaryRect = QApplication::desktop()->availableGeometry(primary); + + QPixmap desktop( + QPixmap::grabWindow( + QApplication::desktop()->winId(), + primaryRect.x(), + primaryRect.y(), + primaryRect.width(), + primaryRect.height() + ).scaled( x, y, Qt::KeepAspectRatio, Qt::SmoothTransformation)); diff --git a/src/client/toolbar/toolbar.cpp b/src/client/toolbar/toolbar.cpp index f016680..34dafd5 100644 --- a/src/client/toolbar/toolbar.cpp +++ b/src/client/toolbar/toolbar.cpp @@ -35,7 +35,7 @@ void Toolbar::setupMenu() { _menu = new QMenu(this); // setup actions - _acnDisconnect = new QAction(tr("&Connect"), this); + _acnDisconnect = new QAction(tr("Set &session ID"), this); //_acnDisconnect->setEnabled(false); _acnQuit = new QAction(tr("&Quit"), this); diff --git a/src/client/vnc/vncserver.cpp b/src/client/vnc/vncserver.cpp index 8c1469a..3eca952 100644 --- a/src/client/vnc/vncserver.cpp +++ b/src/client/vnc/vncserver.cpp @@ -5,7 +5,10 @@ * Author: sr */ + +#include <QApplication> #include <QProcess> +#include <QDesktopWidget> #include "vncserver.h" #include "../util/util.h" @@ -96,6 +99,20 @@ void VncServer::start() args << "-shared"; args << "-repeat"; args << "-autoport" << QString::number(54112); + + // Get rect of primary screen + int primary = QApplication::desktop()->primaryScreen(); + QRect primaryRect = QApplication::desktop()->availableGeometry(primary); + + // Tell x11vnc to just use primary screen + args << "-clip"; + QString rect; + rect = QString::number(primaryRect.width()) + + "x" + QString::number(primaryRect.height()) + + "+" + QString::number(primaryRect.x()) + + "+" + QString::number(primaryRect.y()); + args << rect; + qDebug() << "Arguments are: " << args; _process->start("x11vnc", args, |
