VirtualBox

Changeset 27160 in vbox for trunk/src


Ignore:
Timestamp:
Mar 8, 2010 12:05:02 PM (15 years ago)
Author:
vboxsync
Message:

Main: don't assert in Mouse code all over the place. Now that we have absolute mouse coordinates, the GUI may send mouse events after having destroyed its session and console, and we shouldn't assert then

File:
1 edited

Legend:

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

    r27159 r27160  
    286286
    287287        if (RT_FAILURE(vrc))
    288             setError(VBOX_E_IPRT_ERROR,
    289                      tr("Could not send the mouse event to the virtual mouse (%Rrc)"),
    290                      vrc);
    291         AssertRCReturn(vrc, VBOX_E_IPRT_ERROR);
     288            return setError(VBOX_E_IPRT_ERROR,
     289                            tr("Could not send the mouse event to the virtual mouse (%Rrc)"),
     290                            vrc);
    292291    }
    293292    return S_OK;
     
    318317                                          dw, fButtons);
    319318        if (RT_FAILURE(vrc))
    320             setError(VBOX_E_IPRT_ERROR,
    321                      tr("Could not send the mouse event to the virtual mouse (%Rrc)"),
    322                      vrc);
    323         AssertRCReturn(vrc, VBOX_E_IPRT_ERROR);
     319            return setError(VBOX_E_IPRT_ERROR,
     320                            tr("Could not send the mouse event to the virtual mouse (%Rrc)"),
     321                            vrc);
    324322    }
    325323    return S_OK;
     
    344342                                                   mouseXAbs, mouseYAbs);
    345343        if (RT_FAILURE(vrc))
    346             setError(VBOX_E_IPRT_ERROR,
    347                      tr("Could not send the mouse event to the virtual mouse (%Rrc)"),
    348                      vrc);
    349         AssertRCReturn(vrc, VBOX_E_IPRT_ERROR);
     344            return setError(VBOX_E_IPRT_ERROR,
     345                            tr("Could not send the mouse event to the virtual mouse (%Rrc)"),
     346                            vrc);
    350347    }
    351348    return S_OK;
     
    403400
    404401    ULONG displayWidth;
    405     int rc = pDisplay->COMGETTER(Width)(&displayWidth);
    406     ComAssertComRCRet(rc, rc);
     402    HRESULT rc = pDisplay->COMGETTER(Width)(&displayWidth);
     403    if (FAILED(rc)) return rc;
    407404
    408405    *pcX = displayWidth ? (x * 0xFFFF) / displayWidth: 0;
     
    422419
    423420    ULONG displayHeight;
    424     int rc = pDisplay->COMGETTER(Height)(&displayHeight);
    425     ComAssertComRCRet(rc, rc);
     421    HRESULT rc = pDisplay->COMGETTER(Height)(&displayHeight);
     422    if (FAILED(rc)) return rc;
    426423
    427424    *pcY = displayHeight ? (y * 0xFFFF) / displayHeight: 0;
     
    453450    uint32_t mouseXAbs;
    454451    HRESULT rc = convertDisplayWidth(x, &mouseXAbs);
    455     ComAssertComRCRet(rc, rc);
     452    if (FAILED(rc)) return rc;
     453
    456454    /**
    457455     * @todo multi-monitor Windows guests expect this to be unbounded.
     
    463461    uint32_t mouseYAbs;
    464462    rc = convertDisplayHeight(y, &mouseYAbs);
    465     ComAssertComRCRet(rc, rc);
     463    if (FAILED(rc)) return rc;
    466464    /* if (mouseYAbs > 0xffff)
    467465        mouseYAbs = mLastAbsY; */
     
    471469    uint32_t mouseCaps;
    472470    rc = getVMMDevMouseCaps(&mouseCaps);
    473     ComAssertComRCRet(rc, rc);
     471    if (FAILED(rc)) return rc;
    474472
    475473    /*
     
    500498            rc = reportRelEventToMouseDev(fNeedsJiggle ? 1 : 0, 0, dz, dw,
    501499                                          fButtons);
    502             ComAssertComRCRet(rc, rc);
    503500        }
    504501    }
     
    506503        rc = reportAbsEventToMouseDev(mouseXAbs, mouseYAbs, dz, dw, fButtons);
    507504
    508     ComAssertComRCRet(rc, rc);
     505    if (FAILED(rc)) return rc;
    509506
    510507    mLastAbsX = mouseXAbs;
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