From a5718c9b31d5fb72a88c0e145766efd861e0a3d3 Mon Sep 17 00:00:00 2001 From: Philip Langdale Date: Thu, 13 Nov 2008 15:43:31 -0800 Subject: Only turn on absolute mode when we get an actual event; we don't want the driver to throw us into absolute mode just because the device is present but the user has a relative input path configured. --- src/vmmouse.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/vmmouse.c b/src/vmmouse.c index 9284c0e..ac50902 100644 --- a/src/vmmouse.c +++ b/src/vmmouse.c @@ -310,6 +310,9 @@ VMMousePreInit(InputDriverPtr drv, IDevPtr dev, int flags) if (!mPriv) { return NULL; } + + mPriv->relative = TRUE; + /* * try to enable vmmouse here */ @@ -843,8 +846,6 @@ VMMouseDeviceControl(DeviceIntPtr device, int mode) return FALSE; } else { mPriv->vmmouseAvailable = TRUE; - VMMouseClient_RequestAbsolute(); - mPriv->relative = FALSE; xf86Msg(X_INFO, "VMWARE(0): vmmouse enabled\n"); } } @@ -865,6 +866,7 @@ VMMouseDeviceControl(DeviceIntPtr device, int mode) if( mPriv->vmmouseAvailable ) { VMMouseClient_Disable(); mPriv->vmmouseAvailable = FALSE; + mPriv->relative = TRUE; } xf86RemoveEnabledDevice(pInfo); @@ -914,6 +916,12 @@ VMMouseReadInput(InputInfoPtr pInfo) pMse = pInfo->private; mPriv = pMse->mousePriv; + if (mPriv->relative) { + VMMouseClient_RequestAbsolute(); + mPriv->relative = FALSE; + xf86Msg(X_INFO, "VMWARE(0): vmmouse enable absolute mode\n"); + } + /* * First read the bytes in input device to clear the regular PS/2 fd so * we don't get called again. -- cgit v1.2.3