VirtualBox

Changeset 19614 in vbox


Ignore:
Timestamp:
May 12, 2009 12:27:21 PM (16 years ago)
Author:
vboxsync
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
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Input/DevPS2.cpp

    r12977 r19614  
    779779    s->mouse_dy -= dy;
    780780    s->mouse_dz += dz;
     781#ifndef VBOX
    781782    /* XXX: SDL sometimes generates nul events: we delete them */
    782783    if (s->mouse_dx == 0 && s->mouse_dy == 0 && s->mouse_dz == 0 &&
    783784        s->mouse_buttons == buttons_state)
    784785        return;
     786#else
     787    /* This issue does not affect VBox, and under some circumstances (which?)
     788     * we may wish to send null events to make mouse integration work. */
     789#endif
    785790    s->mouse_buttons = buttons_state;
    786791
  • 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.

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