VirtualBox

Changeset 9006 in vbox for trunk


Ignore:
Timestamp:
May 21, 2008 10:05:35 AM (17 years ago)
Author:
vboxsync
Message:

Additions/x11: fix disabling pointer integration

Location:
trunk/src/VBox/Additions/x11
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/x11/xgraphics/vboxutils.c

    r8949 r9006  
    118118    {
    119119        if (   !(fFeatures & VBOXGUEST_MOUSE_HOST_CANNOT_HWPOINTER)
    120             && (fFeatures & VBOXGUEST_MOUSE_GUEST_CAN_ABSOLUTE))
     120            && (fFeatures & VBOXGUEST_MOUSE_GUEST_CAN_ABSOLUTE)
     121            && (fFeatures & VBOXGUEST_MOUSE_HOST_CAN_ABSOLUTE)
     122           )
    121123            rc = TRUE;
    122124    }
  • trunk/src/VBox/Additions/x11/xmouse/VBoxUtils.c

    r8959 r9006  
    6464
    6565
    66 int VBoxMouseQueryPosition(unsigned int *puAbsXPos, unsigned int *puAbsYPos)
     66/**
     67 * Query the absolute mouse position from the host
     68 * @returns VINF_SUCCESS or iprt error if the absolute values could not
     69 *          be queried, or the host wished to use relative coordinates
     70 * @param   pcx  where to return the pointer X coordinate
     71 * @param   pxy  where to return the pointer Y coordinate
     72 */
     73int VBoxMouseQueryPosition(unsigned int *pcx, unsigned int *pcy)
    6774{
    68     int rc;
    69     uint32_t pointerXPos;
    70     uint32_t pointerYPos;
     75    int rc = VINF_SUCCESS;
     76    uint32_t cx, cy, fFeatures;
    7177
     78    AssertPtrReturn(pcx, VERR_INVALID_PARAMETER);
     79    AssertPtrReturn(pcy, VERR_INVALID_PARAMETER);
    7280    if (gDeviceOpenFailed)
    73         return 2;
    74     AssertPtrReturn(puAbsXPos, VERR_INVALID_PARAMETER);
    75     AssertPtrReturn(puAbsYPos, VERR_INVALID_PARAMETER);
    76     rc = VbglR3GetMouseStatus(NULL, &pointerXPos, &pointerYPos);
    77     if (VBOX_SUCCESS(rc))
     81        rc = VERR_ACCESS_DENIED;
     82    if (RT_SUCCESS(rc))
     83        rc = VbglR3GetMouseStatus(&fFeatures, &cx, &cy);
     84    else
     85        ErrorF("Error querying host mouse position! rc = %d\n", rc);
     86    if (   RT_SUCCESS(rc)
     87        && !(fFeatures & VBOXGUEST_MOUSE_HOST_CAN_ABSOLUTE))
     88        rc = VERR_NOT_SUPPORTED;
     89    if (RT_SUCCESS(rc))
    7890    {
    79         *puAbsXPos = pointerXPos;
    80         *puAbsYPos = pointerYPos;
    81         return 0;
     91        *pcx = cx;
     92        *pcy = cy;
    8293    }
    83     ErrorF("Error querying host mouse position! rc = %d\n", rc);
    84     return 2;
     94    return rc;
    8595}
    8696
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