VirtualBox

Changeset 77485 in vbox


Ignore:
Timestamp:
Feb 27, 2019 1:25:37 PM (6 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
129075
Message:

Main: add out-of-range to host-side pointer reporting.
bugref:9376: Complete hardware cursor implementation in VMSVGA
Clean-ups from previous changes after testing with local GUI changes.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/src-client/MouseImpl.cpp

    r77452 r77485  
    668668    ComAssertRet(pDisplay, E_FAIL);
    669669
    670     if (x == -1 || y == -1)  /* Report only. */
    671         return S_OK;
    672     if (x != mcLastX || y != mcLastY)  /* This covers out-of-range too. */
    673     {
    674         if (x < 0x7fffffff && y < 0x7fffffff)
    675             pDisplay->i_reportHostCursorPosition(x - 1, y - 1, false);
    676         else  /* Out of range. */
    677             pDisplay->i_reportHostCursorPosition(0, 0, true);
     670    if (x != mcLastX || y != mcLastY)
     671    {
     672        pDisplay->i_reportHostCursorPosition(x - 1, y - 1, false);
    678673    }
    679674    return S_OK;
     
    855850             __PRETTY_FUNCTION__, x, y, dz, dw, aButtonState));
    856851
     852    DisplayMouseInterface *pDisplay = mParent->i_getDisplayMouseInterface();
     853    ComAssertRet(pDisplay, E_FAIL);
    857854    int32_t xAdj, yAdj;
    858855    uint32_t fButtonsAdj;
    859856    bool fValid;
    860857
     858    /* If we are doing old-style (IRQ-less) absolute reporting to the VMM
     859     * device then make sure the guest is aware of it, so that it knows to
     860     * ignore relative movement on the PS/2 device. */
     861    i_updateVMMDevMouseCaps(VMMDEV_MOUSE_HOST_WANTS_ABSOLUTE, 0);
     862    /* Detect out-of-range. */
     863    if (x == 0x7FFFFFFF && y == 0x7FFFFFFF)
     864    {
     865        pDisplay->i_reportHostCursorPosition(0, 0, true);
     866        return S_OK;
     867    }
     868    /* Detect "report-only" (-1, -1).  This is not ideal, as in theory the
     869     * front-end could be sending negative values relative to the primary
     870     * screen. */
     871    if (x == -1 && y == -1)
     872        return S_OK;
    861873    /** @todo the front end should do this conversion to avoid races */
    862874    /** @note Or maybe not... races are pretty inherent in everything done in
     
    866878
    867879    fButtonsAdj = i_mouseButtonsToPDM(aButtonState);
    868     /* If we are doing old-style (IRQ-less) absolute reporting to the VMM
    869      * device then make sure the guest is aware of it, so that it knows to
    870      * ignore relative movement on the PS/2 device. */
    871     i_updateVMMDevMouseCaps(VMMDEV_MOUSE_HOST_WANTS_ABSOLUTE, 0);
    872880    if (fValid)
    873881    {
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