Revision: 5071
          http://tigervnc.svn.sourceforge.net/tigervnc/?rev=5071&view=rev
Author:   ossman_
Date:     2013-04-09 15:07:12 +0000 (Tue, 09 Apr 2013)
Log Message:
-----------
Handle init of old and new keyboards the same way.

Modified Paths:
--------------
    trunk/unix/xserver/hw/vnc/Input.cc

Modified: trunk/unix/xserver/hw/vnc/Input.cc
===================================================================
--- trunk/unix/xserver/hw/vnc/Input.cc  2013-04-09 15:01:56 UTC (rev 5070)
+++ trunk/unix/xserver/hw/vnc/Input.cc  2013-04-09 15:07:12 UTC (rev 5071)
@@ -130,21 +130,6 @@
 InputDevice::InputDevice(rfb::VNCServerST *_server)
        : server(_server), initialized(false), oldButtonMask(0)
 {
-#if XORG < 17
-       pointerDev = AddInputDevice(
-#if XORG >= 16
-                                   serverClient,
-#endif
-                                   pointerProc, TRUE);
-       RegisterPointerDevice(pointerDev);
-
-       keyboardDev = AddInputDevice(
-#if XORG >= 16
-                                    serverClient,
-#endif
-                                    keyboardProc, TRUE);
-       RegisterKeyboardDevice(keyboardDev);
-#endif
 #if XORG < 111
        initEventq();
 #endif
@@ -285,14 +270,36 @@
 
 void InputDevice::InitInputDevice(void)
 {
-#if XORG >= 17
-       int ret;
-
-       if (!initialized)
+       if (initialized)
                return;
 
        initialized = true;
 
+#if XORG < 17
+       pointerDev = AddInputDevice(
+#if XORG >= 16
+                                   serverClient,
+#endif
+                                   pointerProc, TRUE);
+       RegisterPointerDevice(pointerDev);
+
+       keyboardDev = AddInputDevice(
+#if XORG >= 16
+                                    serverClient,
+#endif
+                                    keyboardProc, TRUE);
+       RegisterKeyboardDevice(keyboardDev);
+
+       if (ActivateDevice(pointerDev) != Success ||
+           ActivateDevice(keyboardDev) != Success)
+               FatalError("Failed to activate TigerVNC devices\n");
+
+       if (!EnableDevice(pointerDev) ||
+           !EnableDevice(keyboardDev))
+               FatalError("Failed to enable TigerVNC devices\n");
+#else /* < 17 */
+       int ret;
+
        ret = AllocDevicePair(serverClient, "TigerVNC", &pointerDev,
                              &keyboardDev, pointerProc, keyboardProc,
                              FALSE);
@@ -307,7 +314,7 @@
        if (!EnableDevice(pointerDev, TRUE) ||
            !EnableDevice(keyboardDev, TRUE))
                FatalError("Failed to activate TigerVNC devices\n");
-#endif
+#endif /* 17 */
 }
 
 static inline void pressKey(DeviceIntPtr dev, int kc, bool down, const char 
*msg)

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.


------------------------------------------------------------------------------
Precog is a next-generation analytics platform capable of advanced
analytics on semi-structured data. The platform includes APIs for building
apps and a phenomenal toolset for data science. Developers can use
our toolset for easy data analysis & visualization. Get a free account!
http://www2.precog.com/precogplatform/slashdotnewsletter
_______________________________________________
Tigervnc-commits mailing list
Tigervnc-commits@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/tigervnc-commits

Reply via email to