VirtualBox

Changeset 82022 in vbox for trunk/src/VBox/Frontends


Ignore:
Timestamp:
Nov 20, 2019 11:53:25 AM (5 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
134825
Message:

FE/Qt: bugref:9598: UISession: Expose mouse pointer mask pixmap along with the shape pixmap previously available.

Location:
trunk/src/VBox/Frontends/VirtualBox/src/runtime
Files:
3 edited

Legend:

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

    r80617 r82022  
    15171517            || !m_pMachineView->uisession()->isMouseSupportsAbsolute()))
    15181518    {
    1519         /* Acquire session cursor pixmap: */
    1520         QPixmap cursorPixmap = m_pMachineView->uisession()->cursorPixmap();
     1519        /* Acquire session cursor shape pixmap: */
     1520        QPixmap cursorPixmap = m_pMachineView->uisession()->cursorShapePixmap();
    15211521
    15221522        /* Take the device-pixel-ratio into account: */
     
    16261626            || !m_pMachineView->uisession()->isMouseSupportsAbsolute()))
    16271627    {
    1628         /* Acquire session cursor pixmap: */
    1629         QPixmap cursorPixmap = m_pMachineView->uisession()->cursorPixmap();
     1628        /* Acquire session cursor shape pixmap: */
     1629        QPixmap cursorPixmap = m_pMachineView->uisession()->cursorShapePixmap();
    16301630
    16311631        /* Take the device-pixel-ratio into account: */
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UISession.cpp

    r82021 r82022  
    16671667    /* Invalidate mouse pointer shape initially: */
    16681668    m_fIsValidPointerShapePresent = false;
     1669    m_cursorShapePixmap = QPixmap();
     1670    m_cursorMaskPixmap = QPixmap();
    16691671
    16701672    /* Parse incoming shape data: */
     
    16951697            memcpy(image.scanLine(y), pu32SrcShapeScanline, uWidth * sizeof(uint32_t));
    16961698
    1697         m_cursorPixmap = QPixmap::fromImage(image);
    1698         updateMousePointerPixmapScaling(m_cursorPixmap, uXHot, uYHot);
    1699         m_cursor = QCursor(m_cursorPixmap, uXHot, uYHot);
     1699        m_cursorShapePixmap = QPixmap::fromImage(image);
     1700        updateMousePointerPixmapScaling(m_cursorShapePixmap, uXHot, uYHot);
     1701        m_cursor = QCursor(m_cursorShapePixmap, uXHot, uYHot);
    17001702    }
    17011703    else
     
    17861788            }
    17871789
    1788             m_cursorPixmap = QBitmap::fromImage(bitmap);
    1789             updateMousePointerPixmapScaling(m_cursorPixmap, uXHot, uYHot);
    1790             m_cursor = QCursor(m_cursorPixmap, QBitmap::fromImage(mask), uXHot, uYHot);
     1790            m_cursorShapePixmap = QBitmap::fromImage(bitmap);
     1791            m_cursorMaskPixmap = QBitmap::fromImage(mask);
     1792            updateMousePointerPixmapScaling(m_cursorShapePixmap, uXHot, uYHot);
     1793            updateMousePointerPixmapScaling(m_cursorMaskPixmap, uXHot, uYHot);
     1794            m_cursor = QCursor(m_cursorShapePixmap, m_cursorMaskPixmap, uXHot, uYHot);
    17911795        }
    17921796        else
     
    18181822            }
    18191823
    1820             m_cursorPixmap = QPixmap::fromImage(image);
    1821             updateMousePointerPixmapScaling(m_cursorPixmap, uXHot, uYHot);
    1822             m_cursor = QCursor(m_cursorPixmap, uXHot, uYHot);
     1824            m_cursorShapePixmap = QPixmap::fromImage(image);
     1825            updateMousePointerPixmapScaling(m_cursorShapePixmap, uXHot, uYHot);
     1826            m_cursor = QCursor(m_cursorShapePixmap, uXHot, uYHot);
    18231827        }
    18241828    }
     
    18431847
    18441848    /* Create cursor-pixmap from the image: */
    1845     m_cursorPixmap = QPixmap::fromImage(image);
    1846     updateMousePointerPixmapScaling(m_cursorPixmap, uXHot, uYHot);
    1847     m_cursor = QCursor(m_cursorPixmap, uXHot, uYHot);
     1849    m_cursorShapePixmap = QPixmap::fromImage(image);
     1850    updateMousePointerPixmapScaling(m_cursorShapePixmap, uXHot, uYHot);
     1851    m_cursor = QCursor(m_cursorShapePixmap, uXHot, uYHot);
    18481852    m_fIsValidPointerShapePresent = true;
    18491853
     
    18551859
    18561860    /* Cache cursor pixmap size: */
    1857     m_cursorSize = m_cursorPixmap.size();
     1861    m_cursorSize = m_cursorShapePixmap.size();
    18581862}
    18591863
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UISession.h

    r81622 r82022  
    137137    /** Returns currently cached mouse cursor. */
    138138    QCursor cursor() const { return m_cursor; }
    139     /** Returns currently cached mouse cursor pixmap. */
    140     QPixmap cursorPixmap() const { return m_cursorPixmap; }
     139    /** Returns currently cached mouse cursor shape pixmap. */
     140    QPixmap cursorShapePixmap() const { return m_cursorShapePixmap; }
     141    /** Returns currently cached mouse cursor mask pixmap. */
     142    QPixmap cursorMaskPixmap() const { return m_cursorMaskPixmap; }
    141143    /** Returns currently cached mouse cursor size. */
    142144    QSize cursorSize() const { return m_cursorSize; }
     
    512514    /** Holds cached mouse cursor. */
    513515    QCursor  m_cursor;
    514     /** Holds cached mouse cursor pixmap. */
    515     QPixmap  m_cursorPixmap;
     516    /** Holds cached mouse cursor shape pixmap. */
     517    QPixmap  m_cursorShapePixmap;
     518    /** Holds cached mouse cursor mask pixmap. */
     519    QPixmap  m_cursorMaskPixmap;
    516520    /** Holds cached mouse cursor size. */
    517521    QSize    m_cursorSize;
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