VirtualBox

Changeset 26782 in vbox for trunk/src/VBox/Frontends/VBoxSDL


Ignore:
Timestamp:
Feb 25, 2010 11:17:30 AM (15 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
58047
Message:

Main, Frontends: added support for virtual pointing devices with no relative reporting and cleaned up the VMMDev/mouse device absolute reporting interaction

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VBoxSDL/VBoxSDL.cpp

    r26603 r26782  
    185185static BOOL gfAbsoluteMouseHost = FALSE;
    186186static BOOL gfAbsoluteMouseGuest = FALSE;
     187static BOOL gfRelativeMouseGuest = TRUE;
    187188static BOOL gfGuestNeedsHostCursor = FALSE;
    188189static BOOL gfOffCursorActive = FALSE;
     
    430431    }
    431432
    432     STDMETHOD(OnMouseCapabilityChange)(BOOL supportsAbsolute, BOOL needsHostCursor)
    433     {
    434         LogFlow(("OnMouseCapabilityChange: supportsAbsolute = %d\n", supportsAbsolute));
     433    STDMETHOD(OnMouseCapabilityChange)(BOOL supportsAbsolute, BOOL supportsRelative, BOOL needsHostCursor)
     434    {
     435        LogFlow(("OnMouseCapabilityChange: supportsAbsolute = %d, supportsRelative = %d, needsHostCursor = %d\n",
     436                 supportsAbsolute, supportsRelative, needsHostCursor));
    435437        gfAbsoluteMouseGuest   = supportsAbsolute;
     438        gfRelativeMouseGuest   = supportsRelative;
    436439        gfGuestNeedsHostCursor = needsHostCursor;
    437440
     
    38793882    DisableGlobalHotKeys(true);
    38803883#endif
    3881     if (!gfGuestNeedsHostCursor)
     3884    if (!gfGuestNeedsHostCursor && gfRelativeMouseGuest)
    38823885        SDL_ShowCursor(SDL_DISABLE);
    38833886    SDL_WM_GrabInput(SDL_GRAB_ON);
     
    38983901{
    38993902    SDL_WM_GrabInput(SDL_GRAB_OFF);
    3900     if (!gfGuestNeedsHostCursor)
     3903    if (!gfGuestNeedsHostCursor && gfRelativeMouseGuest)
    39013904        SDL_ShowCursor(SDL_ENABLE);
    39023905#ifdef RT_OS_DARWIN
     
    39313934     * If supported and we're not in grabbed mode, we'll use the absolute mouse.
    39323935     * If we are in grabbed mode and the guest is not able to draw the mouse cursor
    3933      * itself, we have to use absolute coordinates, otherwise the host cursor and
     3936     * itself, or can't handle relative reporting, we have to use absolute
     3937     * coordinates, otherwise the host cursor and
    39343938     * the coordinates the guest thinks the mouse is at could get out-of-sync. From
    39353939     * the SDL mailing list:
     
    39393943     * call SDL_GetMouseState, the "button" is already up."
    39403944     */
    3941     abs = (UseAbsoluteMouse() && !gfGrabbed) || gfGuestNeedsHostCursor;
     3945    abs =    (UseAbsoluteMouse() && !gfGrabbed)
     3946          || gfGuestNeedsHostCursor
     3947          || !gfRelativeMouseGuest;
    39423948
    39433949    /* only used if abs == TRUE */
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