VNC: Finish initializing the VNC server once we have the NX handle
This commit is contained in:
parent
909b081113
commit
d7226cc6ba
@ -56,6 +56,10 @@
|
|||||||
# include <pthread.h>
|
# include <pthread.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef CONFIG_VNCSERVER
|
||||||
|
# include <nuttx/video/vnc.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "nxconfig.hxx"
|
#include "nxconfig.hxx"
|
||||||
#include "singletons.hxx"
|
#include "singletons.hxx"
|
||||||
#include "cnxserver.hxx"
|
#include "cnxserver.hxx"
|
||||||
@ -203,6 +207,18 @@ bool CNxServer::connect(void)
|
|||||||
return false;
|
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;
|
return true;
|
||||||
}
|
}
|
||||||
#endif // CONFIG_NX_MULTIUSER
|
#endif // CONFIG_NX_MULTIUSER
|
||||||
@ -254,6 +270,19 @@ bool CNxServer::connect(void)
|
|||||||
{
|
{
|
||||||
pthread_attr_t attr;
|
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
|
// 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
|
// the least efficient way to do this, but it makes this logic flow more
|
||||||
// smoothly.
|
// smoothly.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user