diff options
author | Adam Tkac <atkac@redhat.com> | 2013-03-14 17:52:53 +0000 |
---|---|---|
committer | Adam Tkac <atkac@redhat.com> | 2013-03-14 17:52:53 +0000 |
commit | fc23895f80b6ab8d19add9bd3f18bfd5818e8935 (patch) | |
tree | 3787580b101e08407b2761faa8fcf286a67c8e9b /unix | |
parent | 40060b4e1a8a93ab23b0652f16504f1982e3501d (diff) | |
download | tigervnc-fc23895f80b6ab8d19add9bd3f18bfd5818e8935.tar.gz tigervnc-fc23895f80b6ab8d19add9bd3f18bfd5818e8935.zip |
Initialize VNC extension from libvnc.so only once.
git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@5065 3789f03b-4d11-0410-bbf8-ca57d06f2519
Diffstat (limited to 'unix')
-rw-r--r-- | unix/xserver/hw/vnc/xf86vncModule.cc | 31 |
1 files changed, 18 insertions, 13 deletions
diff --git a/unix/xserver/hw/vnc/xf86vncModule.cc b/unix/xserver/hw/vnc/xf86vncModule.cc index 9352c807..58964ccf 100644 --- a/unix/xserver/hw/vnc/xf86vncModule.cc +++ b/unix/xserver/hw/vnc/xf86vncModule.cc @@ -90,26 +90,31 @@ vncSetup(pointer module, pointer opts, int *errmaj, int *errmin) { static void vncExtensionInitWithParams(INITARGS) { - rfb::initStdIOLoggers(); - rfb::LogWriter::setLogParams("*:stderr:30"); - rfb::Configuration::enableServerParams(); + static char once = 0; - for (int scr = 0; scr < screenInfo.numScreens; scr++) { - ScrnInfoPtr pScrn = xf86Screens[scr]; + if (!once) { + once++; + rfb::initStdIOLoggers(); + rfb::LogWriter::setLogParams("*:stderr:30"); + rfb::Configuration::enableServerParams(); - for (ParameterIterator i; i.param; i.next()) { - const char *val; + for (int scr = 0; scr < screenInfo.numScreens; scr++) { + ScrnInfoPtr pScrn = xf86Screens[scr]; + + for (ParameterIterator i; i.param; i.next()) { + const char *val; #if XORG < 112 - val = xf86FindOptionValue(pScrn->options, i.param->getName()); + val = xf86FindOptionValue(pScrn->options, i.param->getName()); #else - val = xf86FindOptionValue((XF86OptionPtr)pScrn->options, i.param->getName()); + val = xf86FindOptionValue((XF86OptionPtr)pScrn->options, i.param->getName()); #endif - if (val) - i.param->setParam(val); + if (val) + i.param->setParam(val); + } } - } - vncExtensionInit(); + vncExtensionInit(); + } } } |