aboutsummaryrefslogtreecommitdiffstats
path: root/unix/x0vncserver/x0vncserver.cxx
diff options
context:
space:
mode:
authorConstantin Kaplinsky <const@tightvnc.com>2008-06-04 03:58:07 +0000
committerConstantin Kaplinsky <const@tightvnc.com>2008-06-04 03:58:07 +0000
commit23c60222f2d481166230788c87df801ec2902678 (patch)
tree03839bcf302c45804bb97a3d728771541d1a759d /unix/x0vncserver/x0vncserver.cxx
parente0c80c566649a80697556b767cd014a9625e913f (diff)
downloadtigervnc-23c60222f2d481166230788c87df801ec2902678.tar.gz
tigervnc-23c60222f2d481166230788c87df801ec2902678.zip
Code improvements and better error checking in the Geometry class:
coordinates are now kept as a Rect, added new getRect() method. Also, when the "Geometry" parameter is present but not valid, the constructor will not set the geometry to full screen, zero-size rectangle will be used instead. In that case, x0vncserver will exit with error. git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@2573 3789f03b-4d11-0410-bbf8-ca57d06f2519
Diffstat (limited to 'unix/x0vncserver/x0vncserver.cxx')
-rw-r--r--unix/x0vncserver/x0vncserver.cxx4
1 files changed, 4 insertions, 0 deletions
diff --git a/unix/x0vncserver/x0vncserver.cxx b/unix/x0vncserver/x0vncserver.cxx
index f2ff4306..5016d12c 100644
--- a/unix/x0vncserver/x0vncserver.cxx
+++ b/unix/x0vncserver/x0vncserver.cxx
@@ -438,6 +438,10 @@ int main(int argc, char** argv)
TXWindow::init(dpy,"x0vncserver");
Geometry geo(DisplayWidth(dpy, DefaultScreen(dpy)),
DisplayHeight(dpy, DefaultScreen(dpy)));
+ if (geo.getRect().is_empty()) {
+ vlog.error("Exiting with error");
+ return 1;
+ }
XDesktop desktop(dpy, &geo);
VNCServerST server("x0vncserver", &desktop);