[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

xserver-xorg-input-vmmouse: Changes to 'upstream-unstable'



 configure.ac         |   13 ++-
 man/Makefile.am      |    1 
 src/vmmouse.c        |  200 ++++++++++++++++++++++++++-------------------------
 src/vmmouse_client.c |    6 +
 src/vmmouse_proto.h  |   12 ++-
 5 files changed, 130 insertions(+), 102 deletions(-)

New commits:
commit e72f4fbc61f4a0acf99a4b31f16fdebde9d339f1
Author: Vinay Bondhugula <vinayb@vmware.com>
Date:   Wed May 21 01:36:53 2008 -0400

    Don't call conversion_proc for older Xservers
    
    There was a bug in the Xserver for a while when it didn't call a driver's
    conversion_proc to convert device space coordinates to screen space. To fix
    this, vmmouse starting calling that method (since January), but if this is done
    on older versions of X, the conversion gets done twice.
    
    The fix is to add a configure check for the right versions of X and call
    VMMouseConvertProc() only if we are compiling against an X that has the bug.
    
    There's some whitespace cleanup for vmmouse.c too.

diff --git a/configure.ac b/configure.ac
index 7013426..a57851f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -80,7 +80,12 @@ sdkdir=$(pkg-config --variable=sdkdir xorg-server)
 
 PKG_CHECK_EXISTS([xorg-server >= 1.1.0],
                  [AC_DEFINE([HAVE_XORG_SERVER_1_1_0], 1,
-                 [Has version 1.1.0 or greater of the Xserver])])
+                            [Has version 1.1.0 or greater of the Xserver])])
+
+PKG_CHECK_EXISTS([xorg-server >= 1.3.99.0 xorg-server <= 1.4.0.90],
+                 [AC_DEFINE([CALL_CONVERSION_PROC], 1,
+                            [Call conversion_proc from within the driver, as
+                             Xserver doesn't])])
 
 CFLAGS="$CFLAGS $XORG_CFLAGS "' -I$(top_srcdir)/src'
 AC_SUBST([CFLAGS])
diff --git a/src/vmmouse.c b/src/vmmouse.c
index 8c9ba55..1e2a1c9 100644
--- a/src/vmmouse.c
+++ b/src/vmmouse.c
@@ -139,8 +139,8 @@ static void MouseCtrl(DeviceIntPtr device, PtrCtrl *ctrl);
  *****************************************************************************/
 typedef struct {
    int 		screenNum;
-   Bool 	vmmouseAvailable; 
-   Bool		relative; 
+   Bool 	vmmouseAvailable;
+   Bool		relative;
 } VMMousePrivRec, *VMMousePrivPtr;
 
 static const char *reqSymbols[] = {
@@ -195,7 +195,7 @@ InputDriverRec VMMOUSE = {
    "vmmouse",
    NULL,
    VMMousePreInit,
-   VMMouseUnInit,  
+   VMMouseUnInit,
    NULL,
    0
 };
@@ -231,8 +231,8 @@ typedef enum {
 /*
  * Define the acceptable mouse options
  * Currently not all of those options are supported
- * 
- */ 
+ *
+ */
 static const OptionInfoRec mouseOptions[] = {
     { OPTION_ALWAYS_CORE,	"AlwaysCore",	  OPTV_BOOLEAN,	{0}, FALSE },
     { OPTION_SEND_CORE_EVENTS,	"SendCoreEvents", OPTV_BOOLEAN,	{0}, FALSE },
@@ -277,12 +277,12 @@ static char reverseMap[32] = { 0,  4,  2,  6,  1,  5,  3,  7,
  *	This function collect all the information that is necessary to
  *	determine the configuration of the hardware and to prepare the
  *	device for being used
- * 
+ *
  * Results:
  * 	An InputInfoPtr object which points to vmmouse's information,
  *	if the absolute pointing device available
  *	Otherwise, an InputInfoPtr of regular mouse
- *	
+ *
  * Side effects:
  * 	VMMouse was initialized with necessary information
  *
@@ -291,7 +291,7 @@ static char reverseMap[32] = { 0,  4,  2,  6,  1,  5,  3,  7,
 
 static InputInfoPtr
 VMMousePreInit(InputDriverPtr drv, IDevPtr dev, int flags)
-{              
+{
    InputInfoPtr pInfo;
    MouseDevPtr pMse;
    VMMousePrivPtr mPriv;
@@ -299,14 +299,14 @@ VMMousePreInit(InputDriverPtr drv, IDevPtr dev, int flags)
 
    /*
     * let Xserver init the mouse first
-    */ 
+    */
    osInfo = xf86OSMouseInit(0);
    if (!osInfo)
       return FALSE;
-   
+
    mPriv = xcalloc (1, sizeof (VMMousePrivRec));
 
-   
+
    if (!mPriv) {
       return NULL;
    }
@@ -328,7 +328,7 @@ VMMousePreInit(InputDriverPtr drv, IDevPtr dev, int flags)
       } else {
 	 return NULL;
       }
-      
+
    } else {
       /*
        * vmmouse is available
@@ -339,16 +339,16 @@ VMMousePreInit(InputDriverPtr drv, IDevPtr dev, int flags)
        * Disable the absolute pointing device for now
        * It will be enabled during DEVICE_ON phase
        */
-      VMMouseClient_Disable(); 	
+      VMMouseClient_Disable();
    }
-   
+
    if (!(pInfo = xf86AllocateInput(drv, 0))) {
       xfree(mPriv);
       return NULL;
-   }	
+   }
 
    /* Settup the pInfo */
-   pInfo->name = dev->identifier;			
+   pInfo->name = dev->identifier;
    pInfo->type_name = XI_MOUSE;
    pInfo->flags = XI86_POINTER_CAPABLE | XI86_SEND_DRAG_EVENTS;
    pInfo->device_control = VMMouseDeviceControl;
@@ -378,7 +378,7 @@ VMMousePreInit(InputDriverPtr drv, IDevPtr dev, int flags)
    pMse->PostEvent = VMMousePostEvent;
    pMse->CommonOptions = MouseCommonOptions;
    pMse->mousePriv = mPriv;
-   
+
 
    /* Collect the options, and process the common options. */
    xf86CollectInputOptions(pInfo, NULL, NULL);
@@ -400,13 +400,13 @@ VMMousePreInit(InputDriverPtr drv, IDevPtr dev, int flags)
    }
    xf86CloseSerial(pInfo->fd);
    pInfo->fd = -1;
-   
+
    /* Process the options */
    pMse->CommonOptions(pInfo);
-   
+
    /* set up the current screen num */
    mPriv->screenNum = xf86SetIntOption(pInfo->options, "ScreenNumber", 0);
-    
+
    pInfo->flags |= XI86_CONFIGURED;
    return pInfo;
 }
@@ -424,11 +424,11 @@ VMMouseAvailableOptions(void *unused)
  *----------------------------------------------------------------------
  *
  * MouseCtrl --
- *     Alter the control paramters for the mouse. 
- *	
+ *     Alter the control paramters for the mouse.
+ *
  * Results:
- * 	None 
- *	
+ * 	None
+ *
  * Side effects:
  * 	None
  *
@@ -447,7 +447,7 @@ MouseCtrl(DeviceIntPtr device, PtrCtrl *ctrl)
 #ifdef EXTMOUSEDEBUG
     xf86Msg(X_INFO, "VMMOUSE(0): MouseCtrl pMse=%p\n", pMse);
 #endif
-    
+
     pMse->num       = ctrl->num;
     pMse->den       = ctrl->den;
     pMse->threshold = ctrl->threshold;
@@ -459,10 +459,10 @@ MouseCtrl(DeviceIntPtr device, PtrCtrl *ctrl)
  *
  * VMMouseDoPostEvent --
  *	Post the mouse button event and mouse motion event to Xserver
- *	
+ *
  * Results:
  * 	None
- *	
+ *
  * Side effects:
  * 	Mouse location and button status was updated
  *
@@ -476,7 +476,7 @@ VMMouseDoPostEvent(InputInfoPtr pInfo, int buttons, int dx, int dy)
     VMMousePrivPtr mPriv;
     int truebuttons;
     int id, change;
-    
+
     pMse = pInfo->private;
     mPriv = (VMMousePrivPtr)pMse->mousePriv;
 
@@ -484,21 +484,23 @@ VMMouseDoPostEvent(InputInfoPtr pInfo, int buttons, int dx, int dy)
      * The following truebuttons/reverseBits and lastButtons are
      * used to compare the current buttons and the previous buttons
      * to find the button changes during two mouse events
-     */ 
+     */
     truebuttons = buttons;
 
     buttons = reverseBits(reverseMap, buttons);
 
     if (dx || dy) {
 
+#ifdef CALL_CONVERSION_PROC
         /*
-         * The Xserver no longer calls an input device's conversion_proc
-         * to convert x and y coordinates from device to screen space.
+         * Xservers between 1.3.99.0 - 1.4.0.90 do not call conversion_proc, so
+         * we need to do the conversion from device to screen space.
          */
         VMMouseConvertProc(pInfo, 0, 2, dx, dy, 0, 0, 0, 0, &dx, &dy);
+#endif
         xf86PostMotionEvent(pInfo->dev, !mPriv->relative, 0, 2, dx, dy);
     }
-    
+
     if (truebuttons != pMse->lastButtons) {
        change = buttons ^ reverseBits(reverseMap, pMse->lastButtons);
        while (change) {
@@ -518,10 +520,10 @@ VMMouseDoPostEvent(InputInfoPtr pInfo, int buttons, int dx, int dy)
  * VMMousePostEvent --
  *	Prepare the mouse status according to the Z axis mapping
  *	before we post the event to Xserver
- *	
+ *
  * Results:
  * 	None
- *	
+ *
  * Side effects:
  * 	Buttons was updated according to Z axis mapping
  *
@@ -534,7 +536,7 @@ VMMousePostEvent(InputInfoPtr pInfo, int buttons, int dx, int dy, int dz, int dw
     MouseDevPtr pMse;
     int zbutton = 0;
     VMMousePrivPtr mPriv;
-    
+
     pMse = pInfo->private;
     mPriv = (VMMousePrivPtr)pMse->mousePriv;
     /* Map the Z axis movement. */
@@ -547,7 +549,7 @@ VMMousePostEvent(InputInfoPtr pInfo, int buttons, int dx, int dy, int dz, int dw
 	   if(mPriv->relative)
 	      dx = dz;
 	   else
-	      dx += dz; 
+	      dx += dz;
 	    dz = 0;
 	}
 	break;
@@ -556,7 +558,7 @@ VMMousePostEvent(InputInfoPtr pInfo, int buttons, int dx, int dy, int dz, int dw
 	   if(mPriv->relative)
 	      dy = dz;
 	   else
-	      dy += dz; 
+	      dy += dz;
 	    dz = 0;
 	}
 	break;
@@ -606,7 +608,7 @@ VMMousePostEvent(InputInfoPtr pInfo, int buttons, int dx, int dy, int dz, int dw
  *
  * Results:
  * 	None
- *	
+ *
  * Side effects:
  * 	None
  *
@@ -637,11 +639,11 @@ FlushButtons(MouseDevPtr pMse)
  * MouseCommonOptions --
  *	Process acceptable mouse options. Currently we only process
  *	"Buttons" and "ZAxisMapping" options.
- *	More options can be added later on 
+ *	More options can be added later on
  *
  * Results:
  * 	None
- *	
+ *
  * Side effects:
  * 	The buttons was setup according to the options
  *
@@ -696,9 +698,9 @@ MouseCommonOptions(InputInfoPtr pInfo)
 	 pMse->positiveZ = pMse->positiveW = 1 << (b2-1);
 	 if (b1 > pMse->buttons) pMse->buttons = b1;
 	 if (b2 > pMse->buttons) pMse->buttons = b2;
-	 
+
 	 /*
-	  * Option "ZAxisMapping" "N1 N2 N3 N4" not supported 
+	  * Option "ZAxisMapping" "N1 N2 N3 N4" not supported
 	  */
 	 pMse->negativeW = pMse->positiveW = MSE_NOZMAP;
       } else {
@@ -719,7 +721,7 @@ MouseCommonOptions(InputInfoPtr pInfo)
     */
    if (origButtons != pMse->buttons)
       from = X_CONFIG;
-    
+
 }
 
 
@@ -732,14 +734,14 @@ MouseCommonOptions(InputInfoPtr pInfo)
  *
  * Results:
  * 	None
- *	
+ *
  * Side effects:
  * 	None
  *
  *----------------------------------------------------------------------
  */
 
-static void 
+static void
 VMMouseUnInit(InputDriverPtr drv, LocalDevicePtr local, int flags)
 {
    xf86Msg(X_INFO, "VMWARE(0): VMMouseUnInit\n");
@@ -751,12 +753,12 @@ VMMouseUnInit(InputDriverPtr drv, LocalDevicePtr local, int flags)
  *
  * VMMouseDeviceControl --
  * 	This function was called by Xserver during DEVICE_INIT, DEVICE_ON,
- *	DEVICE_OFF and DEVICE_CLOSE phase 
- *	
+ *	DEVICE_OFF and DEVICE_CLOSE phase
+ *
  * Results:
  * 	TRUE, if sucessful
  *	FALSE, if failed
- *	
+ *
  * Side effects:
  * 	Absolute pointing device is enabled during DEVICE_ON
  *	Absolute pointing device is disabled during DEVICE_OFF
@@ -773,11 +775,11 @@ VMMouseDeviceControl(DeviceIntPtr device, int mode)
    VMMousePrivPtr mPriv;
    unsigned char map[MSE_MAXBUTTONS + 1];
    int i;
-    
+
    pInfo = device->public.devicePrivate;
    pMse = pInfo->private;
    pMse->device = device;
-   mPriv = (VMMousePrivPtr)pMse->mousePriv;    
+   mPriv = (VMMousePrivPtr)pMse->mousePriv;
 
    switch (mode){
    case DEVICE_INIT:
@@ -837,17 +839,17 @@ VMMouseDeviceControl(DeviceIntPtr device, int mode)
 	       /*
 		* enable absolute pointing device here
 		*/
-	       if (!VMMouseClient_Enable()) { 
+	       if (!VMMouseClient_Enable()) {
 		  xf86Msg(X_ERROR, "VMWARE(0): vmmouse enable failed\n");
 		  mPriv->vmmouseAvailable = FALSE;
 		  device->public.on = FALSE;
 		  return FALSE;
 	       } else {
-		  mPriv->vmmouseAvailable = TRUE; 
+		  mPriv->vmmouseAvailable = TRUE;
 		  VMMouseClient_RequestAbsolute();
 		  mPriv->relative = FALSE;
 		  xf86Msg(X_INFO, "VMWARE(0): vmmouse enabled\n");
-	       }		
+	       }
 	    }
 	    xf86FlushInput(pInfo->fd);
 	    xf86AddEnabledDevice(pInfo);
@@ -856,7 +858,7 @@ VMMouseDeviceControl(DeviceIntPtr device, int mode)
       pMse->lastButtons = 0;
       device->public.on = TRUE;
       FlushButtons(pMse);
-      break;	
+      break;
    case DEVICE_OFF:
    case DEVICE_CLOSE:
       xf86Msg(X_INFO, "VMWARE(0): VMMOUSE DEVICE_OFF/CLOSE\n");
@@ -867,7 +869,7 @@ VMMouseDeviceControl(DeviceIntPtr device, int mode)
 	    VMMouseClient_Disable();
 	    mPriv->vmmouseAvailable = FALSE;
 	 }
-	    
+
 	 xf86RemoveEnabledDevice(pInfo);
 	 if (pMse->buffer) {
 	    XisbFree(pMse->buffer);
@@ -892,15 +894,15 @@ VMMouseDeviceControl(DeviceIntPtr device, int mode)
  * VMMouseReadInput --
  * 	This function was called by Xserver when there is data available
  *	in the input device
- *	
+ *
  * Results:
  * 	None
- *		
+ *
  * Side effects:
  * 	Input data in regular PS/2 fd was cleared
  *	Real mouse data was read from the absolute pointing device
  *	and posted to Xserver
- *	
+ *
  *----------------------------------------------------------------------
  */
 
@@ -908,16 +910,16 @@ static void
 VMMouseReadInput(InputInfoPtr pInfo)
 {
    MouseDevPtr pMse;
-   VMMousePrivPtr mPriv; 
+   VMMousePrivPtr mPriv;
    int c;
-   int len = 0; 
+   int len = 0;
 
    pMse = pInfo->private;
    mPriv = pMse->mousePriv;
- 
+
    /*
     * First read the bytes in input device to clear the regular PS/2 fd so
-    * we don't get called again. 
+    * we don't get called again.
     */
    /*
     * Set blocking to -1 on the first call because we know there is data to
@@ -930,10 +932,10 @@ VMMouseReadInput(InputInfoPtr pInfo)
       len++;
       /*
        * regular PS packet consists of 3 bytes
-       * We read 3 bytes to drain the PS/2 packet 
+       * We read 3 bytes to drain the PS/2 packet
        */
       if(len < 3) continue;
-      len = 0; 
+      len = 0;
       /*
        * Now get the real data from absolute pointing device
        */
@@ -952,14 +954,14 @@ VMMouseReadInput(InputInfoPtr pInfo)
  * GetVMMouseMotionEvent --
  * 	Read all the mouse data available from the absolute
  * 	pointing device	and post it to the Xserver
- *	
+ *
  * Results:
  * 	None
- *		
+ *
  * Side effects:
  *	Real mouse data was read from the absolute pointing
  *	device and posted to Xserver
- *	
+ *
  *----------------------------------------------------------------------
  */
 
@@ -971,7 +973,7 @@ GetVMMouseMotionEvent(InputInfoPtr pInfo){
    int ps2Buttons = 0;
    int numPackets;
 
-   pMse = pInfo->private;  
+   pMse = pInfo->private;
    while((numPackets = VMMouseClient_GetInput(&vmmouseInput))){
       if (numPackets == VMMOUSE_ERROR) {
          VMMouseClient_Disable();
@@ -987,13 +989,13 @@ GetVMMouseMotionEvent(InputInfoPtr pInfo){
 	 ps2Buttons |= 0x02; 			/* Right*/
       if(vmmouseInput.Buttons & VMMOUSE_LEFT_BUTTON)
 	 ps2Buttons |= 0x01; 			/* Left*/
-	      
+
       buttons = (ps2Buttons & 0x04) >> 1 |	/* Middle */
 	 (ps2Buttons & 0x02) >> 1 |       	/* Right */
 	 (ps2Buttons & 0x01) << 2;       	/* Left */
-	   
+
       dx = vmmouseInput.X;
-      dy = vmmouseInput.Y; 
+      dy = vmmouseInput.Y;
       dz = (char)vmmouseInput.Z;
       dw = 0;
       /* post an event */
@@ -1006,11 +1008,11 @@ GetVMMouseMotionEvent(InputInfoPtr pInfo){
  *----------------------------------------------------------------------
  *
  * VMMouseControlProc --
- *	This function is unused 
+ *	This function is unused
  *
  * Results:
  * 	None
- *	
+ *
  * Side effects:
  * 	None
  *
@@ -1029,11 +1031,11 @@ VMMouseControlProc(LocalDevicePtr local, xDeviceCtl * control)
  *----------------------------------------------------------------------
  *
  *  VMMouseCloseProc --
- *	This function is unused 
+ *	This function is unused
  *
  * Results:
  * 	None
- *	
+ *
  * Side effects:
  * 	None
  *
@@ -1051,11 +1053,11 @@ VMMouseCloseProc(LocalDevicePtr local)
  *----------------------------------------------------------------------
  *
  *  VMMouseSwitchProc --
- *	This function is unused 
+ *	This function is unused
  *
  * Results:
  * 	None
- *	
+ *
  * Side effects:
  * 	None
  *
@@ -1075,13 +1077,13 @@ VMMouseSwitchMode(ClientPtr client, DeviceIntPtr dev, int mode)
  *
  * VMMouseConvertProc  --
  * 	This function was called by Xserver to convert valuators to X and Y
- *	
+ *
  * Results:
  * 	TRUE
- *		
+ *
  * Side effects:
  * 	X and Y was converted according to current Screen dimension
- *	
+ *
  *----------------------------------------------------------------------
  */
 
@@ -1098,17 +1100,17 @@ VMMouseConvertProc(InputInfoPtr pInfo, int first, int num, int v0, int v1, int v
 
    if (first != 0 || num != 2)
       return FALSE;
-   
+
    if(mPriv->relative) {
       *x = v0;
       *y = v1;
    } else {
       factorX = ((double) screenInfo.screens[mPriv->screenNum]->width) / (double) 65535;
       factorY = ((double) screenInfo.screens[mPriv->screenNum]->height) / (double) 65535;
-      
+
       *x = v0 * factorX + 0.5;
       *y = v1 * factorY + 0.5;
-      
+
       if (mPriv->screenNum != -1) {
 	 xf86XInputSetScreen(pInfo, mPriv->screenNum, *x, *y);
       }
@@ -1132,13 +1134,13 @@ ModuleInfoRec VMMouseInfo = {
  *
  * VMMouseUnplug  --
  * 	This function was called by Xserver when unplug
- *	
+ *
  * Results:
  * 	None
- *		
+ *
  * Side effects:
  * 	None
- *	
+ *
  *----------------------------------------------------------------------
  */
 
@@ -1154,16 +1156,16 @@ VMMouseUnplug(pointer p)
  *
  * VMMousePlug  --
  * 	This function was called when Xserver load vmmouse module. It will
- * 	integrate the  module infto the XFree86 loader architecutre. 
- *	
+ * 	integrate the  module infto the XFree86 loader architecutre.
+ *
  * Results:
  * 	TRUE
- *		
+ *
  * Side effects:
- * 	Regular mouse module was loaded as a submodule. In case 
+ * 	Regular mouse module was loaded as a submodule. In case
  * 	absolute pointing device is not available, we can always fall back
  *	to the regular mouse module
- *	
+ *
  *----------------------------------------------------------------------
  */
 
@@ -1177,7 +1179,7 @@ VMMousePlug(pointer	module,
    char *name;
 
    xf86LoaderReqSymLists(reqSymbols, NULL);
-   
+
    if (!Initialised) {
       Initialised = TRUE;
 #ifndef REMOVE_LOADER_CHECK_MODULE_INFO
@@ -1204,7 +1206,7 @@ VMMousePlug(pointer	module,
       LoaderErrorMsg(NULL, name, *errmaj, *errmin);
    }
    xfree(name);
-    
+
    return module;
 }
 

commit 08f6ba03b1368e23bda4d51b16e182079fe9c409
Author: Vinay Bondhugula <vinayb@vmware.com>
Date:   Tue Apr 22 18:53:16 2008 -0400

    Compatibility with older versions of X
    
    - Makes the driver compile againt older versions of X (tested upto 4.3).
    - Bump up the version number in configure.ac and the modinfo section.
    - A couple of trivial whitespace cleanups.

diff --git a/configure.ac b/configure.ac
index 4374b2b..7013426 100644
--- a/configure.ac
+++ b/configure.ac
@@ -22,7 +22,7 @@
 
 AC_PREREQ(2.57)
 AC_INIT([xf86-input-vmmouse],
-        12.5.0,
+        12.5.1,
         [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg],
         xf86-input-vmmouse)
 
@@ -75,9 +75,13 @@ XORG_DRIVER_CHECK_EXT(RANDR, randrproto)
 XORG_DRIVER_CHECK_EXT(XINPUT, inputproto)
 
 # Checks for pkg-config packages
-PKG_CHECK_MODULES(XORG, [xorg-server >= 1.0.99.901] xproto $REQUIRED_MODULES)
+PKG_CHECK_MODULES(XORG, [xorg-server >= 1.0.1] xproto $REQUIRED_MODULES)
 sdkdir=$(pkg-config --variable=sdkdir xorg-server)
 
+PKG_CHECK_EXISTS([xorg-server >= 1.1.0],
+                 [AC_DEFINE([HAVE_XORG_SERVER_1_1_0], 1,
+                 [Has version 1.1.0 or greater of the Xserver])])
+
 CFLAGS="$CFLAGS $XORG_CFLAGS "' -I$(top_srcdir)/src'
 AC_SUBST([CFLAGS])
 
diff --git a/src/vmmouse.c b/src/vmmouse.c
index bd3763b..8c9ba55 100644
--- a/src/vmmouse.c
+++ b/src/vmmouse.c
@@ -32,11 +32,11 @@
  *
  * 	This is a modified version of the mouse input driver
  * 	provided in Xserver/hw/xfree86/input/mouse/mouse.c
- *      
+ *
  *      Although all data is read using the vmmouse protocol, notification
  *      is still done through the PS/2 port, so all the basic code for
  *      interacting with the port is retained.
- * 	
+ *
  */
 
 
@@ -94,8 +94,8 @@
  * Version constants
  */
 #define VMMOUSE_MAJOR_VERSION 12
-#define VMMOUSE_MINOR_VERSION 4
-#define VMMOUSE_PATCHLEVEL 3
+#define VMMOUSE_MINOR_VERSION 5
+#define VMMOUSE_PATCHLEVEL 1
 #define VMMOUSE_DRIVER_VERSION \
    (VMMOUSE_MAJOR_VERSION * 65536 + VMMOUSE_MINOR_VERSION * 256 + VMMOUSE_PATCHLEVEL)
 #define VMMOUSE_DRIVER_VERSION_STRING \
diff --git a/src/vmmouse_proto.h b/src/vmmouse_proto.h
index 6a08e27..a2eb1e4 100644
--- a/src/vmmouse_proto.h
+++ b/src/vmmouse_proto.h
@@ -36,10 +36,20 @@
 #ifndef _VMMOUSE_PROTO_H_
 #define _VMMOUSE_PROTO_H_
 
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
 #include <stdint.h>
+
+#ifdef HAVE_XORG_SERVER_1_1_0
 #include <unistd.h>
+#else
+#include "xf86_libc.h"
+#endif
 
-#if !defined __i386__ && !defined __x86_64__ 
+#if !defined __i386__ && !defined __x86_64__
 #error The vmmouse protocol is only supported on x86 architectures.
 #endif
 

commit f9629096c1e0ac0e090642cf6a53674842aaf9a8
Author: Adam Jackson <ajax@redhat.com>
Date:   Thu Mar 20 16:53:05 2008 -0400

    vmmouse 12.5.0

diff --git a/configure.ac b/configure.ac
index a049195..4374b2b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -22,7 +22,7 @@
 
 AC_PREREQ(2.57)
 AC_INIT([xf86-input-vmmouse],
-        12.4.3,
+        12.5.0,
         [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg],
         xf86-input-vmmouse)
 

commit a88387f1276d598843ffa0cd3648f8bf34d10680
Author: Matthieu Herrb <matthieu@bluenote.herrb.net>
Date:   Sat Mar 8 23:17:40 2008 +0100

    Makefile.am: nuke RCS Id

diff --git a/man/Makefile.am b/man/Makefile.am
index bf7ec17..f0eb29b 100644
--- a/man/Makefile.am
+++ b/man/Makefile.am
@@ -1,4 +1,3 @@
-# $Id$
 #
 # Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
 # 

commit c312189cedf7526d61ced521f275ad5c4a972610
Author: Vinay Bondhugula <vinayb@vmware.com>
Date:   Tue Jan 22 23:32:12 2008 -0800

    Fix device to screen space coordinate conversion
    
    The Xserver no longer calls an input device's conversion_proc to convert x and
    y coordinates from device to screen space. This fix calls the conversion
    routine in vmmouse.c before posting the motion event to Xserver.
    
    Other drivers also seem to rely on conversion_proc, so the real fix should probably
    go into Xserver's code (maybe in xserver/hw/xfree86/common/xf86Xinput.c?).

diff --git a/src/vmmouse.c b/src/vmmouse.c
index be1087e..bd3763b 100644
--- a/src/vmmouse.c
+++ b/src/vmmouse.c
@@ -490,7 +490,13 @@ VMMouseDoPostEvent(InputInfoPtr pInfo, int buttons, int dx, int dy)
     buttons = reverseBits(reverseMap, buttons);
 
     if (dx || dy) {
-       xf86PostMotionEvent(pInfo->dev, !mPriv->relative, 0, 2, dx, dy);
+
+        /*
+         * The Xserver no longer calls an input device's conversion_proc
+         * to convert x and y coordinates from device to screen space.
+         */
+        VMMouseConvertProc(pInfo, 0, 2, dx, dy, 0, 0, 0, 0, &dx, &dy);
+        xf86PostMotionEvent(pInfo->dev, !mPriv->relative, 0, 2, dx, dy);
     }
     
     if (truebuttons != pMse->lastButtons) {

commit ca3eb5abeb187a1e40ff7c36bf87d52efb999be9
Author: Vinay Bondhugula <vinayb@vmware.com>
Date:   Sat Jan 19 09:07:16 2008 -0800

    Fix an old sign bug for the relative mode
    
    Higher order bits for the X and Y inputs (which could be set in case of a
    relative mouse) were being zeroed off in VMMouseClient_GetInput. This change
    fixes it.

diff --git a/src/vmmouse_client.c b/src/vmmouse_client.c
index 5f27e54..f34c223 100644
--- a/src/vmmouse_client.c
+++ b/src/vmmouse_client.c
@@ -267,9 +267,11 @@ VMMouseClient_GetInput (PVMMOUSE_INPUT_DATA pvmmouseInput) {
    pvmmouseInput->Flags = (packetInfo & 0xffff0000) >> 16;
    pvmmouseInput->Buttons = (packetInfo & 0x0000ffff);
 
-   pvmmouseInput->X = vmpc.out.vEbx & 0xffff;
-   pvmmouseInput->Y = vmpc.out.vEcx & 0xffff;
+   /* Note that Z is always signed, and X/Y are signed in relative mode. */
+   pvmmouseInput->X = (int)vmpc.out.vEbx;
+   pvmmouseInput->Y = (int)vmpc.out.vEcx;
    pvmmouseInput->Z = (int)vmpc.out.vEdx;
+
    /*
     * Return number of packets (including this one) in queue.
     */


Reply to: