VirtualBox

Ignore:
Timestamp:
Apr 4, 2019 1:37:38 PM (6 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
129791
Message:

FE/Qt: bugref:9376: Make framebuffer cursor react on mouse pointer shape changes as well, not just on cursor position changes; This handler allows to process animated cursor shapes and hide framebuffer cursor if it's became hidden, like in VM reset case.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIFrameBuffer.cpp

    r78016 r78018  
    276276protected slots:
    277277
     278    /** Handles guest request to change the mouse pointer shape. */
     279    void sltMousePointerShapeChange();
    278280    /** Handles guest request to change the cursor position. */
    279281    void sltCursorPositionChange();
     
    12981300}
    12991301
     1302void UIFrameBufferPrivate::sltMousePointerShapeChange()
     1303{
     1304    /* Do we have view and valid cursor position?
     1305     * Also, please take into account, we are not currently painting
     1306     * framebuffer cursor if mouse integration is supported and enabled. */
     1307    if (   m_pMachineView
     1308        && !m_pMachineView->uisession()->isHidingHostPointer()
     1309        && m_pMachineView->uisession()->isValidPointerShapePresent()
     1310        && m_pMachineView->uisession()->isValidCursorPositionPresent()
     1311        && (   !m_pMachineView->uisession()->isMouseIntegrated()
     1312            || !m_pMachineView->uisession()->isMouseSupportsAbsolute()))
     1313    {
     1314        /* Call for a viewport update using known shape rectangle: */
     1315        m_pMachineView->viewport()->update(m_cursorRectangle);
     1316    }
     1317    /* Don't forget to clear the rectangle in opposite case: */
     1318    else if (   m_pMachineView
     1319             && m_cursorRectangle.isValid())
     1320    {
     1321        /* Call for a viewport update: */
     1322        m_pMachineView->viewport()->update(m_cursorRectangle);
     1323        /* And erase the rectangle after all: */
     1324        m_cursorRectangle = QRect();
     1325    }
     1326}
     1327
    13001328void UIFrameBufferPrivate::sltCursorPositionChange()
    13011329{
     
    13691397
    13701398    /* Attach GUI connections: */
     1399    connect(m_pMachineView->uisession(), &UISession::sigMousePointerShapeChange,
     1400            this, &UIFrameBufferPrivate::sltMousePointerShapeChange);
    13711401    connect(m_pMachineView->uisession(), &UISession::sigCursorPositionChange,
    13721402            this, &UIFrameBufferPrivate::sltCursorPositionChange);
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