VirtualBox

Changeset 19614 in vbox for trunk/src/VBox/Main


Ignore:
Timestamp:
May 12, 2009 12:27:21 PM (16 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
47192
Message:

Main and Devices: absolute mouse support: do not send a mouse movement event if only the button state has changed

Location:
trunk/src/VBox/Main
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/MouseImpl.cpp

    r15716 r19614  
    5959{
    6060    mpDrv = NULL;
     61    mLastAbsX = 0;
     62    mLastAbsY = 0;
    6163    return S_OK;
    6264}
     
    315317            fButtons |= PDMIMOUSEPORT_BUTTON_MIDDLE;
    316318
    317         vrc = mpDrv->pUpPort->pfnPutEvent(mpDrv->pUpPort, 1, 1, dz,
    318                                           fButtons);
     319        /* This is a workaround.  In order to alert the Guest Additions to the
     320         * fact that the absolute pointer position has changed, we send a
     321         * a minute movement event to the PS/2 mouse device.  But in order
     322         * to avoid the mouse jiggling every time the use clicks, we check to
     323         * see if the position has really changed since the last mouse event.
     324         */
     325        if ((mLastAbsX == mouseXAbs) && (mLastAbsY == mouseYAbs))
     326            vrc = mpDrv->pUpPort->pfnPutEvent(mpDrv->pUpPort, 0, 0, dz,
     327                                              fButtons);
     328        else
     329            vrc = mpDrv->pUpPort->pfnPutEvent(mpDrv->pUpPort, 1, 1, dz,
     330                                              fButtons);
     331        mLastAbsX = mouseXAbs;
     332        mLastAbsY = mouseYAbs;
    319333        if (RT_FAILURE (vrc))
    320334            rc = setError (VBOX_E_IPRT_ERROR,
  • trunk/src/VBox/Main/include/MouseImpl.h

    r19239 r19614  
    106106
    107107    LONG uHostCaps;
     108    uint32_t mLastAbsX;
     109    uint32_t mLastAbsY;
    108110};
    109111
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette