diff --git a/libnxwidgets/src/cnxserver.cxx b/libnxwidgets/src/cnxserver.cxx index 06e979f22..5c70bda57 100644 --- a/libnxwidgets/src/cnxserver.cxx +++ b/libnxwidgets/src/cnxserver.cxx @@ -56,6 +56,10 @@ # include #endif +#ifdef CONFIG_VNCSERVER +# include +#endif + #include "nxconfig.hxx" #include "singletons.hxx" #include "cnxserver.hxx" @@ -203,6 +207,18 @@ bool CNxServer::connect(void) return false; } +#ifdef CONFIG_VNCSERVER + // Setup the VNC server to support keyboard/mouse inputs + + ret = vnc_default_fbinitialize(0, m_hNxServer); + if (ret < 0) + { + gdbg("CNxServer::connect: vnc_default_fbinitialize failed: %d\n", ret); + disconnect(); + return false; + } +#endif + return true; } #endif // CONFIG_NX_MULTIUSER @@ -254,6 +270,19 @@ bool CNxServer::connect(void) { pthread_attr_t attr; +#ifdef CONFIG_VNCSERVER + // Setup the VNC server to support keyboard/mouse inputs + + ret = vnc_default_fbinitialize(0, m_hNxServer); + if (ret < 0) + { + gdbg("CNxServer::connect: vnc_default_fbinitialize failed: %d\n", ret); + m_running = false; + disconnect(); + return false; + } +#endif + // Start a separate thread to listen for server events. This is probably // the least efficient way to do this, but it makes this logic flow more // smoothly.