]> source.dussan.org Git - tigervnc.git/commitdiff
Initialize input devices in XserverDesktop constructor and update
authorAdam Tkac <atkac@redhat.com>
Wed, 26 Mar 2008 17:13:33 +0000 (17:13 +0000)
committerAdam Tkac <atkac@redhat.com>
Wed, 26 Mar 2008 17:13:33 +0000 (17:13 +0000)
InitPointerDeviceStruct and mieqInit parameters.

git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/branches/1.5-xserver@2448 3789f03b-4d11-0410-bbf8-ca57d06f2519

unix/xserver/hw/vnc/XserverDesktop.cc
unix/xserver/hw/vnc/xvnc.cc

index 7071b714c7d67d37c9797d9cb02319e2799f9847..6dfe3d5c6582c3fd82249c7db0bff8f3d4d9bcec 100644 (file)
@@ -56,6 +56,12 @@ extern char *display;
 #undef class
 }
 
+DeviceIntPtr vncKeyboardDevice = NULL;
+DeviceIntPtr vncPointerDevice = NULL;
+
+static int vfbKeybdProc(DeviceIntPtr pDevice, int onoff);
+static int vfbMouseProc(DeviceIntPtr pDevice, int onoff);
+
 using namespace rfb;
 using namespace network;
 
@@ -202,6 +208,16 @@ XserverDesktop::XserverDesktop(ScreenPtr pScreen_,
 
   if (httpListener)
     httpServer = new FileHTTPServer(this);
+
+  if (vncKeyboardDevice == NULL) {
+    vncKeyboardDevice = AddInputDevice(vfbKeybdProc, TRUE);
+    RegisterKeyboardDevice(vncKeyboardDevice);
+  }
+
+  if (vncPointerDevice == NULL) {
+    vncPointerDevice = AddInputDevice(vfbMouseProc, TRUE);
+    RegisterPointerDevice(vncPointerDevice);
+  }
 }
 
 XserverDesktop::~XserverDesktop()
@@ -1335,8 +1351,8 @@ static int vfbMouseProc(DeviceIntPtr pDevice, int onoff)
     map[3] = 3;
     map[4] = 4;
     map[5] = 5;
-    InitPointerDeviceStruct(pDev, map, 5, miPointerGetMotionEvents,
-                            (PtrCtrlProcPtr)NoopDDA, miPointerGetMotionBufferSize());
+    InitPointerDeviceStruct(pDev, map, 5, GetMotionHistory,
+                            (PtrCtrlProcPtr)NoopDDA, GetMotionHistorySize(), 2);
     break;
 
   case DEVICE_ON:
index 42ad72db2d8083cdfb9507722a74c187e4acc618..25847a661981d75fb2a5d5b5d6b53771894cbf24 100644 (file)
@@ -1251,11 +1251,5 @@ void ProcessInputEvents()
 
 void InitInput(int argc, char *argv[])
 {
-  DeviceIntPtr p, k;
-  p = AddInputDevice(vfbMouseProc, TRUE);
-  k = AddInputDevice(vfbKeybdProc, TRUE);
-  RegisterPointerDevice(p);
-  RegisterKeyboardDevice(k);
-  miRegisterPointerDevice(screenInfo.screens[0], p);
-  (void)mieqInit ((DevicePtr)k, (DevicePtr)p);
+  mieqInit ();
 }