VirtualBox

Ignore:
Timestamp:
Sep 5, 2011 9:53:44 PM (13 years ago)
Author:
vboxsync
Message:

Additions/common and X11: more VBOXGUEST_IOCTL_SET_MOUSE_STATUS adjustments

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

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/x11/vboxmouse/VBoxUtils.c

    r35398 r38648  
    4949    }
    5050
    51     rc = VbglR3GetMouseStatus(&fFeatures, NULL, NULL);
    52     if (RT_SUCCESS(rc))
    53         rc = VbglR3SetMouseStatus(  fFeatures
    54                                   | VMMDEV_MOUSE_GUEST_CAN_ABSOLUTE);
     51    rc = VbglR3SetMouseStatus(VMMDEV_MOUSE_GUEST_CAN_ABSOLUTE);
    5552    if (RT_FAILURE(rc))
    5653    {
     
    9895int VBoxMouseFini(void)
    9996{
    100     if (gDeviceOpenFailed)
    101         return VINF_SUCCESS;
    102     uint32_t fFeatures;
    103     int rc = VbglR3GetMouseStatus(&fFeatures, NULL, NULL);
    104     if (RT_SUCCESS(rc))
    105         rc = VbglR3SetMouseStatus(  fFeatures
    106                                   & ~VMMDEV_MOUSE_GUEST_CAN_ABSOLUTE);
    10797    VbglR3Term();
    108     return rc;
     98    return VINF_SUCCESS;
    10999}
  • trunk/src/VBox/Additions/x11/vboxmouse/VBoxUtils_68.c

    r32831 r38648  
    9090int VBoxMouseInit(void)
    9191{
    92     VMMDevReqMouseStatus req;
     92    uint32_t fFeatures;
    9393
    9494    /* return immediately if already initialized */
     
    115115
    116116    /* tell the host that we want absolute coordinates */
    117     vmmdevInitRequest((VMMDevRequestHeader*)&req, VMMDevReq_SetMouseStatus);
    118     req.mouseFeatures = VMMDEV_MOUSE_GUEST_CAN_ABSOLUTE | VMMDEV_MOUSE_GUEST_NEEDS_HOST_CURSOR;
    119     req.pointerXPos = 0;
    120     req.pointerYPos = 0;
     117    fFeatures = VMMDEV_MOUSE_GUEST_CAN_ABSOLUTE;
    121118/** @todo r=bird: Michael, I thought we decided a long time ago that all these should be replaced by VbglR3. I assume this is just a leftover... */
    122     if (ioctl(g_vboxguestHandle, VBOXGUEST_IOCTL_VMMREQUEST(sizeof(req)), (void*)&req) < 0)
     119    if (ioctl(g_vboxguestHandle, VBOXGUEST_IOCTL_SET_MOUSE_STATUS, &fFeatures)
     120        < 0)
    123121    {
    124122        ErrorF("Error sending mouse pointer capabilities to VMM! rc = %d (%s)\n",
     
    175173    if (g_vboxguestHandle < 0)
    176174        return 0;
    177     /* tell VMM that we no longer support absolute mouse handling */
    178     vmmdevInitRequest((VMMDevRequestHeader*)&req, VMMDevReq_SetMouseStatus);
    179     req.mouseFeatures = 0;
    180     req.pointerXPos = 0;
    181     req.pointerYPos = 0;
    182 /** @todo r=bird: Michael, ditto. */
    183     if (ioctl(g_vboxguestHandle, VBOXGUEST_IOCTL_VMMREQUEST(sizeof(req)), (void*)&req) < 0)
    184     {
    185         ErrorF("ioctl to vboxguest module failed, rc = %d (%s)\n",
    186                errno, strerror(errno));
    187     }
    188 
     175    /* Tell VMM that we no longer support absolute mouse handling - done
     176     * automatically when we close the handle. */
    189177    free(g_vmmreqMouseStatus);
    190178    g_vmmreqMouseStatus = NULL;
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