]> source.dussan.org Git - tigervnc.git/commitdiff
Initialize VNC extension from libvnc.so only once.
authorAdam Tkac <atkac@redhat.com>
Thu, 14 Mar 2013 17:52:53 +0000 (17:52 +0000)
committerAdam Tkac <atkac@redhat.com>
Thu, 14 Mar 2013 17:52:53 +0000 (17:52 +0000)
git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@5065 3789f03b-4d11-0410-bbf8-ca57d06f2519

unix/xserver/hw/vnc/xf86vncModule.cc

index 9352c807098a60528abd3544c1461947652bc0ca..58964ccfe38e6f79b6ffd73fe7b4fe7cff7272ef 100644 (file)
@@ -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();
+  }
 }
 }