VirtualBox

Changeset 23422 in vbox for trunk/src/VBox/Additions/x11


Ignore:
Timestamp:
Sep 29, 2009 8:47:35 PM (16 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
52996
Message:

Additions/x11/vboxvideo: use a software mouse cursor if the virtual resolution is greater than the actual resolution for XFree86 as well

Location:
trunk/src/VBox/Additions/x11/vboxvideo
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/x11/vboxvideo/vboxutils_68.c

    r21227 r23422  
    140140    VMMDevReqMouseStatus req;
    141141
    142     int vrc = vmmdevInitRequest ((VMMDevRequestHeader*)&req, VMMDevReq_GetMouseStatus);
    143     if (RT_FAILURE (vrc))
    144         xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
    145             "Unable to determine whether the virtual machine supports mouse pointer integration - request initialization failed with return code %d\n", rc);
    146 #ifdef RT_OS_LINUX
    147     if (   RT_SUCCESS(vrc)
    148         && (ioctl(pVBox->vbox_fd, VBOXGUEST_IOCTL_VMMREQUEST(sizeof(req)), (void*)&req) < 0))
    149 #else
    150 # error port me!
    151 #endif
    152     {
    153         vrc = VERR_FILE_IO_ERROR;
    154         xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
    155             "Unable to determine whether the virtual machine supports mouse pointer integration - request system call failed: %s.\n",
    156             strerror(errno));
    157     }
    158     if (   RT_SUCCESS(rc)
    159         && !(req.mouseFeatures & VMMDEV_MOUSE_HOST_CANNOT_HWPOINTER)
    160         && (req.mouseFeatures & VMMDEV_MOUSE_GUEST_CAN_ABSOLUTE))
    161             rc = TRUE;
     142    /* We may want to force the use of a software cursor.  Currently this is
     143     * needed if the guest uses a large virtual resolution, as in this case
     144     * the host and guest tend to disagree about the pointer location. */
     145    if (pVBox->forceSWCursor)
     146        rc = FALSE;
     147    else
     148    {
     149        int vrc = vmmdevInitRequest ((VMMDevRequestHeader*)&req, VMMDevReq_GetMouseStatus);
     150        if (RT_FAILURE (vrc))
     151            xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
     152                "Unable to determine whether the virtual machine supports mouse pointer integration - request initialization failed with return code %d\n", rc);
     153    #ifdef RT_OS_LINUX
     154        if (   RT_SUCCESS(vrc)
     155            && (ioctl(pVBox->vbox_fd, VBOXGUEST_IOCTL_VMMREQUEST(sizeof(req)), (void*)&req) < 0))
     156    #else
     157    # error port me!
     158    #endif
     159        {
     160            vrc = VERR_FILE_IO_ERROR;
     161            xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
     162                "Unable to determine whether the virtual machine supports mouse pointer integration - request system call failed: %s.\n",
     163                strerror(errno));
     164        }
     165        if (   RT_SUCCESS(rc)
     166            && !(req.mouseFeatures & VMMDEV_MOUSE_HOST_CANNOT_HWPOINTER)
     167            && (req.mouseFeatures & VMMDEV_MOUSE_GUEST_CAN_ABSOLUTE))
     168                rc = TRUE;
     169    }
    162170    return rc;
    163171}
     
    861869#endif
    862870
     871    /* Hide the host cursor before we initialise if we wish to use a
     872     * software cursor. */
     873    if (pVBox->forceSWCursor)
     874        vbox_vmm_hide_cursor(pScrn, pVBox);
    863875    rc = xf86InitCursor (pScreen, pCurs);
    864876    if (rc == TRUE)
  • trunk/src/VBox/Additions/x11/vboxvideo/vboxvideo_68.c

    r21292 r23422  
    803803    }
    804804    pVBox = VBOXGetRec(pScrn);
     805    /* We force a software cursor if the guests virtual resolution is different
     806     * to it's actual resolution, as in this case host and guest will disagree
     807     * about the pointer position. */
     808    if (   (pScrn->virtualX - xRes >= 8)
     809        || (pScrn->virtualY - pMode->VDisplay >= 8))
     810        pVBox->forceSWCursor = TRUE;
     811    else
     812        pVBox->forceSWCursor = FALSE;
     813
    805814    pScrn->vtSema = TRUE;
    806815    /* Disable linear framebuffer mode before making changes to the resolution. */
  • trunk/src/VBox/Additions/x11/vboxvideo/vboxvideo_68.h

    r21227 r23422  
    154154    Bool useVbva;
    155155    int viewportX, viewportY;
     156    Bool forceSWCursor;
    156157    VMMDevVideoAccelFlush *reqf;
    157158    VMMDevVideoAccelEnable *reqe;
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