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

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



 src/vmmouse.c |   11 ++++++++++-
 1 files changed, 10 insertions(+), 1 deletion(-)

New commits:
commit 87d047e6132d5734ab65f0ef18354608dae39ec8
Author: Philip Langdale <philipl@fido2.homeip.net>
Date:   Tue Feb 27 18:02:43 2007 -0800

    Under certain circumstances, typically when the kernel PS/2 driver decides
    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.

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)



Reply to: