configure.ac | 8 +++---- man/vmmouse.man | 2 - shared/vmmouse_defs.h | 6 +++++ shared/vmmouse_proto.h | 9 ++++++++ src/vmmouse.c | 53 ++++++++++++++++++++++++++++++++++--------------- tools/vmmouse_detect.c | 6 +++++ 6 files changed, 63 insertions(+), 21 deletions(-)
New commits: commit d61609868697825717d2f6a63b2a6177cb13873b Author: Shelley Gong <shelleyg...@vmware.com> Date: Mon May 11 10:08:56 2009 -0700 1) Fix bug where motion notify events were being sent with every button event. 2) Classify relative vs. absolute packets individually rather than from a global flag. 3) Compile with older distros. 4) Bump for 12.6.4 Release. Signed-off-by: Philip Langdale <phil...@fido2.homeip.net> diff --git a/configure.ac b/configure.ac index 118ae84..ab39f6c 100644 --- a/configure.ac +++ b/configure.ac @@ -22,7 +22,7 @@ AC_PREREQ(2.57) AC_INIT([xf86-input-vmmouse], - 12.6.3, + 12.6.4, [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], xf86-input-vmmouse) diff --git a/shared/vmmouse_defs.h b/shared/vmmouse_defs.h index 8dc769e..d256faf 100644 --- a/shared/vmmouse_defs.h +++ b/shared/vmmouse_defs.h @@ -57,6 +57,12 @@ #define VMMOUSE_ERROR 0xffff0000 /* + * VMMouse Input packet flags + */ +#define VMMOUSE_MOVE_RELATIVE 1 +#define VMMOUSE_MOVE_ABSOLUTE 0 + +/* * VMMouse Input button flags */ #define VMMOUSE_LEFT_BUTTON 0x20 diff --git a/src/vmmouse.c b/src/vmmouse.c index a712bd5..deec8c8 100644 --- a/src/vmmouse.c +++ b/src/vmmouse.c @@ -95,7 +95,7 @@ */ #define VMMOUSE_MAJOR_VERSION 12 #define VMMOUSE_MINOR_VERSION 6 -#define VMMOUSE_PATCHLEVEL 2 +#define VMMOUSE_PATCHLEVEL 4 #define VMMOUSE_DRIVER_VERSION \ (VMMOUSE_MAJOR_VERSION * 65536 + VMMOUSE_MINOR_VERSION * 256 + VMMOUSE_PATCHLEVEL) #define VMMOUSE_DRIVER_VERSION_STRING \ @@ -138,9 +138,11 @@ static void MouseCtrl(DeviceIntPtr device, PtrCtrl *ctrl); * Definitions *****************************************************************************/ typedef struct { - int screenNum; - Bool vmmouseAvailable; - Bool relative; + int screenNum; + Bool vmmouseAvailable; + VMMOUSE_INPUT_DATA vmmousePrevInput; + Bool isCurrRelative; + Bool absoluteRequested; } VMMousePrivRec, *VMMousePrivPtr; static const char *reqSymbols[] = { @@ -311,7 +313,7 @@ VMMousePreInit(InputDriverPtr drv, IDevPtr dev, int flags) return NULL; } - mPriv->relative = TRUE; + mPriv->absoluteRequested = FALSE; /* * try to enable vmmouse here @@ -479,6 +481,7 @@ VMMouseDoPostEvent(InputInfoPtr pInfo, int buttons, int dx, int dy) VMMousePrivPtr mPriv; int truebuttons; int id, change; + Bool mouseMoved = FALSE; pMse = pInfo->private; mPriv = (VMMousePrivPtr)pMse->mousePriv; @@ -492,7 +495,14 @@ VMMouseDoPostEvent(InputInfoPtr pInfo, int buttons, int dx, int dy) buttons = reverseBits(reverseMap, buttons); - if (dx || dy) { + if (mPriv->isCurrRelative) { + mouseMoved = dx || dy; + } else { + mouseMoved = (dx != mPriv->vmmousePrevInput.X) || + (dy != mPriv->vmmousePrevInput.Y) || + (mPriv->vmmousePrevInput.Flags & VMMOUSE_MOVE_RELATIVE); + } + if (mouseMoved) { #ifdef CALL_CONVERSION_PROC /* @@ -501,7 +511,7 @@ VMMouseDoPostEvent(InputInfoPtr pInfo, int buttons, int dx, int dy) */ VMMouseConvertProc(pInfo, 0, 2, dx, dy, 0, 0, 0, 0, &dx, &dy); #endif - xf86PostMotionEvent(pInfo->dev, !mPriv->relative, 0, 2, dx, dy); + xf86PostMotionEvent(pInfo->dev, !mPriv->isCurrRelative, 0, 2, dx, dy); } if (truebuttons != pMse->lastButtons) { @@ -549,7 +559,7 @@ VMMousePostEvent(InputInfoPtr pInfo, int buttons, int dx, int dy, int dz, int dw break; case MSE_MAPTOX: if (dz != 0) { - if(mPriv->relative) + if(mPriv->isCurrRelative) dx = dz; else dx += dz; @@ -558,7 +568,7 @@ VMMousePostEvent(InputInfoPtr pInfo, int buttons, int dx, int dy, int dz, int dw break; case MSE_MAPTOY: if (dz != 0) { - if(mPriv->relative) + if(mPriv->isCurrRelative) dy = dz; else dy += dz; @@ -593,7 +603,7 @@ VMMousePostEvent(InputInfoPtr pInfo, int buttons, int dx, int dy, int dz, int dw */ if (zbutton) { buttons &= ~zbutton; - if(mPriv->relative) + if(mPriv->isCurrRelative) VMMouseDoPostEvent(pInfo, buttons, 0, 0); else VMMouseDoPostEvent(pInfo, buttons, dx, dy); @@ -621,7 +631,6 @@ static void FlushButtons(MouseDevPtr pMse) { pMse->lastButtons = 0; - pMse->lastMappedButtons = 0; } @@ -865,8 +874,8 @@ VMMouseDeviceControl(DeviceIntPtr device, int mode) VMMousePrivPtr mPriv = (VMMousePrivPtr)pMse->mousePriv; if( mPriv->vmmouseAvailable ) { VMMouseClient_Disable(); - mPriv->vmmouseAvailable = FALSE; - mPriv->relative = TRUE; + mPriv->vmmouseAvailable = FALSE; + mPriv->absoluteRequested = FALSE; } xf86RemoveEnabledDevice(pInfo); @@ -916,9 +925,14 @@ VMMouseReadInput(InputInfoPtr pInfo) pMse = pInfo->private; mPriv = pMse->mousePriv; - if (mPriv->relative) { + if (!mPriv->absoluteRequested) { + /* + * We can request for absolute mode, but it depends on + * host whether it will send us absolute or relative + * position. + */ VMMouseClient_RequestAbsolute(); - mPriv->relative = FALSE; + mPriv->absoluteRequested = TRUE; xf86Msg(X_INFO, "VMWARE(0): vmmouse enable absolute mode\n"); } @@ -973,12 +987,14 @@ VMMouseReadInput(InputInfoPtr pInfo) static void GetVMMouseMotionEvent(InputInfoPtr pInfo){ MouseDevPtr pMse; + VMMousePrivPtr mPriv; int buttons, dx, dy, dz, dw; VMMOUSE_INPUT_DATA vmmouseInput; int ps2Buttons = 0; int numPackets; pMse = pInfo->private; + mPriv = (VMMousePrivPtr)pMse->mousePriv; while((numPackets = VMMouseClient_GetInput(&vmmouseInput))){ if (numPackets == VMMOUSE_ERROR) { VMMouseClient_Disable(); @@ -1003,8 +1019,13 @@ GetVMMouseMotionEvent(InputInfoPtr pInfo){ dy = vmmouseInput.Y; dz = (char)vmmouseInput.Z; dw = 0; + /* + * Get the per package relative or absolute information. + */ + mPriv->isCurrRelative = vmmouseInput.Flags & VMMOUSE_MOVE_RELATIVE; /* post an event */ pMse->PostEvent(pInfo, buttons, dx, dy, dz, dw); + mPriv->vmmousePrevInput = vmmouseInput; } } @@ -1106,7 +1127,7 @@ VMMouseConvertProc(InputInfoPtr pInfo, int first, int num, int v0, int v1, int v if (first != 0 || num != 2) return FALSE; - if(mPriv->relative) { + if(mPriv->isCurrRelative) { *x = v0; *y = v1; } else { diff --git a/tools/vmmouse_detect.c b/tools/vmmouse_detect.c index 0dd4827..ac238b4 100644 --- a/tools/vmmouse_detect.c +++ b/tools/vmmouse_detect.c @@ -30,10 +30,16 @@ #include <signal.h> #include "vmmouse_client.h" +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + void segvCB(int sig) { +#if defined HAVE_XORG_SERVER_1_1_0 exit(1); +#endif } commit d5ae42ec3849672438823b08ad06a69289ae99c5 Author: Alan Coopersmith <alan.coopersm...@sun.com> Date: Thu May 7 15:53:32 2009 -0700 Map Solaris/Sun compiler #defines to gcc equivalents Signed-off-by: Alan Coopersmith <alan.coopersm...@sun.com> diff --git a/shared/vmmouse_proto.h b/shared/vmmouse_proto.h index a2eb1e4..9d7cb22 100644 --- a/shared/vmmouse_proto.h +++ b/shared/vmmouse_proto.h @@ -49,6 +49,15 @@ #include "xf86_libc.h" #endif +/* Map Solaris/Sun compiler #defines to gcc equivalents */ +#if !defined __i386__ && defined __i386 +# define __i386__ +#endif + +#if !defined __x86_64__ && defined __amd64 +# define __x86_64__ +#endif + #if !defined __i386__ && !defined __x86_64__ #error The vmmouse protocol is only supported on x86 architectures. #endif commit 9719534fa3a184b848ef9e9c3a755703b8708fd2 Author: Alan Coopersmith <alan.coopersm...@sun.com> Date: Thu Jan 15 07:29:44 2009 -0800 Make --with-hal* configure options match their help output diff --git a/configure.ac b/configure.ac index 5c5f639..118ae84 100644 --- a/configure.ac +++ b/configure.ac @@ -70,7 +70,7 @@ AC_ARG_WITH(xorg-module-dir, inputdir=${moduledir}/input AC_SUBST(inputdir) -AC_ARG_WITH(hal_bin_dir, +AC_ARG_WITH(hal-bin-dir, AC_HELP_STRING([--with-hal-bin-dir=DIR], [Directory where HAL binaries where installed [[default=$bindir]]]), [halbindir="$withval"], @@ -78,7 +78,7 @@ AC_ARG_WITH(hal_bin_dir, HAL_BIN_DIR=${halbindir} AC_SUBST(HAL_BIN_DIR) -AC_ARG_WITH(hal_callouts_dir, +AC_ARG_WITH(hal-callouts-dir, AC_HELP_STRING([--with-hal-callouts-dir=DIR], [Directory where HAL expects its callout scripts to be located [[default=$libdir/hal]]]), @@ -87,7 +87,7 @@ AC_ARG_WITH(hal_callouts_dir, HAL_CALLOUTS_DIR=${halcalloutsdir} AC_SUBST(HAL_CALLOUTS_DIR) -AC_ARG_WITH(hal_fdi_dir, +AC_ARG_WITH(hal-fdi-dir, AC_HELP_STRING([--with-hal-fdi-dir=DIR], [Directory where HAL expects its fdi files to be located [[default=$datadir/hal/fdi/policy/20thirdparty]]]), commit 5e43144376bfa4491f60dc4da34f8bde9da2f900 Author: Alan Coopersmith <alan.coopersm...@sun.com> Date: Fri Jan 9 16:23:49 2009 -0800 Remove xorgconfig & xorgcfg from See Also list in man page diff --git a/man/vmmouse.man b/man/vmmouse.man index c74f074..6ca1eb5 100644 --- a/man/vmmouse.man +++ b/man/vmmouse.man @@ -41,7 +41,7 @@ See the .B mouse(__drivermansuffix__) man page for details on these options. .SH "SEE ALSO" -__xservername__(1), __xconfigfile__(__filemansuffix__), xorgconfig(1), Xserver(1), X(__miscmansuffix__), +__xservername__(1), __xconfigfile__(__filemansuffix__), Xserver(1), X(__miscmansuffix__), mouse(__drivermansuffix__) .SH AUTHORS Copyright (c) 1999-2007 VMware, Inc. -- To UNSUBSCRIBE, email to debian-x-requ...@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org