VirtualBox

Changeset 77842 in vbox


Ignore:
Timestamp:
Mar 22, 2019 8:12:35 AM (6 years ago)
Author:
vboxsync
Message:

FE/Qt: bugref:9376: Move UIFrameBuffer mouse cursor position listener from UIConsoleEventHandler to UISession, using UISession API instead of caching own stuff.

File:
1 edited

Legend:

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

    r77764 r77842  
    2525#include "UIActionPool.h"
    2626#include "UIActionPoolRuntime.h"
    27 #include "UIConsoleEventHandler.h"
    2827#include "UIFrameBuffer.h"
    2928#include "UISession.h"
     
    277276protected slots:
    278277
    279     /** Handles guest request to change the cursor position to @a uX * @a uY.
    280       * @param  fContainsData  Brings whether the @a uX and @a uY values are valid and could be used by the GUI now. */
    281     void sltCursorPositionChange(bool fContainsData, unsigned long uX, unsigned long uY);
     278    /** Handles guest request to change the cursor position. */
     279    void sltCursorPositionChange();
    282280
    283281protected:
     
    396394     QUuid m_uFramebufferId;
    397395
    398      /** Holds whether cursor position is valid. */
    399      bool   m_fCursorPositionValid;
    400396     /** Holds the last cursor rectangle. */
    401397     QRect  m_cursorRectangle;
     
    542538    , m_dDevicePixelRatioActual(1.0)
    543539    , m_fUseUnscaledHiDPIOutput(false)
    544     , m_fCursorPositionValid(false)
    545540{
    546541    /* Update coordinate-system: */
     
    13031298}
    13041299
    1305 void UIFrameBufferPrivate::sltCursorPositionChange(bool fContainsData, unsigned long uX, unsigned long uY)
    1306 {
    1307     /* Remember whether cursor position is valid: */
    1308     m_fCursorPositionValid = fContainsData;
    1309 
     1300void UIFrameBufferPrivate::sltCursorPositionChange()
     1301{
    13101302    /* Do we have view and valid cursor position? */
    1311     if (m_pMachineView && m_fCursorPositionValid)
     1303    if (m_pMachineView && m_pMachineView->uisession()->isValidCursorPositionPresent())
    13121304    {
    13131305        /* Acquire cursor hotspot: */
    13141306        QPoint cursorHotspot = m_pMachineView->uisession()->cursorHotspot();
    1315 
    13161307        /* Apply the scale-factor if necessary: */
    13171308        cursorHotspot /= scaleFactor();
    1318 
    13191309        /* Take the device-pixel-ratio into account: */
    13201310        if (!useUnscaledHiDPIOutput())
     
    13221312
    13231313        /* Acquire cursor position and size: */
    1324         QPoint cursorPosition = QPoint(uX, uY) - cursorHotspot;
     1314        QPoint cursorPosition = m_pMachineView->uisession()->cursorPosition() - cursorHotspot;
    13251315        QSize cursorSize = m_pMachineView->uisession()->cursorSize();
    1326 
    13271316        /* Apply the scale-factor if necessary: */
    13281317        cursorPosition *= scaleFactor();
    13291318        cursorSize *= scaleFactor();
    1330 
    13311319        /* Take the device-pixel-ratio into account: */
    13321320        if (!useUnscaledHiDPIOutput())
     
    13651353
    13661354    /* Attach GUI connections: */
    1367     connect(gConsoleEvents, &UIConsoleEventHandler::sigCursorPositionChange,
     1355    connect(m_pMachineView->uisession(), &UISession::sigCursorPositionChange,
    13681356            this, &UIFrameBufferPrivate::sltCursorPositionChange);
    13691357}
     
    13821370
    13831371    /* Detach GUI connections: */
    1384     disconnect(gConsoleEvents, &UIConsoleEventHandler::sigCursorPositionChange,
     1372    disconnect(m_pMachineView->uisession(), &UISession::sigCursorPositionChange,
    13851373               this, &UIFrameBufferPrivate::sltCursorPositionChange);
    13861374}
     
    14751463
    14761464    /* Paint cursor if it has valid shape and position: */
    1477     if (m_pMachineView->uisession()->isValidPointerShapePresent() && m_fCursorPositionValid)
     1465    if (m_pMachineView->uisession()->isValidPointerShapePresent() && m_pMachineView->uisession()->isValidCursorPositionPresent())
    14781466    {
    14791467        /* Acquire session cursor pixmap: */
     
    15781566
    15791567    /* Paint cursor if it has valid shape and position: */
    1580     if (m_pMachineView->uisession()->isValidPointerShapePresent() && m_fCursorPositionValid)
     1568    if (m_pMachineView->uisession()->isValidPointerShapePresent() && m_pMachineView->uisession()->isValidCursorPositionPresent())
    15811569    {
    15821570        /* Acquire session cursor pixmap: */
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