diff options
author | Philip Langdale <philipl@fido2.homeip.net> | 2007-02-27 18:02:43 -0800 |
---|---|---|
committer | Philip Langdale <philipl@fido2.homeip.net> | 2007-02-27 18:02:43 -0800 |
commit | 87d047e6132d5734ab65f0ef18354608dae39ec8 (patch) | |
tree | 83b55c0c5f2d56fa63c3b113b3ff1a3f8a347f92 /src/vmmouse.c | |
parent | 16e12c2c08a92a7bb9c11d4a359bf9904998e93f (diff) |
Under certain circumstances, typically when the kernel PS/2 driver decidesvmmouse-12_4_1
to reset the PS/2 device, we can find ourselves in an inconsistent state
between the vmmouse driver and the virtual hardware. When this is encountered,
we should re-request absolute mode from the hardware to get back in sync.
Diffstat (limited to 'src/vmmouse.c')
-rw-r--r-- | src/vmmouse.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/vmmouse.c b/src/vmmouse.c index 5543c4c..2c2683b 100644 --- a/src/vmmouse.c +++ b/src/vmmouse.c @@ -919,9 +919,18 @@ GetVMMouseMotionEvent(InputInfoPtr pInfo){ int buttons, dx, dy, dz, dw; VMMOUSE_INPUT_DATA vmmouseInput; int ps2Buttons = 0; + int numPackets; pMse = pInfo->private; - while(VMMouseClient_GetInput(&vmmouseInput)){ + while((numPackets = VMMouseClient_GetInput(&vmmouseInput))){ + if (numPackets == VMMOUSE_ERROR) { + VMMouseClient_Disable(); + VMMouseClient_Enable(); + VMMouseClient_RequestAbsolute(); + xf86Msg(X_INFO, "VMWARE(0): re-requesting absolute mode after reset\n"); + break; + } + if(vmmouseInput.Buttons & VMMOUSE_MIDDLE_BUTTON) ps2Buttons |= 0x04; /* Middle*/ if(vmmouseInput.Buttons & VMMOUSE_RIGHT_BUTTON) |