diff --git a/unix/spawnvncserver/spawnvncserver.cxx b/unix/spawnvncserver/spawnvncserver.cxx index c406e3c9e7..b5f83e602b 100644 --- a/unix/spawnvncserver/spawnvncserver.cxx +++ b/unix/spawnvncserver/spawnvncserver.cxx @@ -27,7 +27,7 @@ #include #include #include -#include +#include #include #include #include @@ -175,6 +175,16 @@ class FileTcpFilter : public TcpFilter }; +struct VNCServerSpawnXS : public VNCServerSpawnXBase +{ + VNCServerSpawnXS(const char* name_) : VNCServerSpawnXBase(name_) { } + + virtual SDesktop * create_sdesktop() override { + return nullptr; // TODO; +// return new XDesktop(); + } +}; + char* programName; static void printVersion(FILE *fp) @@ -232,13 +242,13 @@ int main(int argc, char** argv) usage(); } - CharArray dpyStr(displayname.getData()); - if (!(dpy = XOpenDisplay(dpyStr.buf[0] ? dpyStr.buf : 0))) { - // FIXME: Why not vlog.error(...)? - fprintf(stderr,"%s: unable to open display \"%s\"\r\n", - programName, XDisplayName(dpyStr.buf)); - exit(1); - } +// CharArray dpyStr(displayname.getData()); +// if (!(dpy = XOpenDisplay(dpyStr.buf[0] ? dpyStr.buf : 0))) { +// // FIXME: Why not vlog.error(...)? +// fprintf(stderr,"%s: unable to open display \"%s\"\r\n", +// programName, XDisplayName(dpyStr.buf)); +// exit(1); +// } signal(SIGHUP, CleanupSignalHandler); signal(SIGINT, CleanupSignalHandler); @@ -247,16 +257,16 @@ int main(int argc, char** argv) std::list listeners; try { - 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); +// 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); + VNCServerSpawnXS server("x0vncserver"); if (rfbunixpath.getValueStr()[0] != '\0') { listeners.push_back(new network::UnixListener(rfbunixpath, rfbunixmode)); @@ -377,10 +387,10 @@ int main(int argc, char** argv) server.processSocketWriteEvent(*i); } - if (desktop.isRunning() && sched.goodTimeToPoll()) { - sched.newPass(); - desktop.poll(); - } +// if (desktop.isRunning() && sched.goodTimeToPoll()) { +// sched.newPass(); +// desktop.poll(); +// } } } catch (rdr::Exception &e) {