summaryrefslogtreecommitdiffstats
path: root/src/client/vnc/vncserver.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/client/vnc/vncserver.cpp')
-rw-r--r--src/client/vnc/vncserver.cpp17
1 files changed, 17 insertions, 0 deletions
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,