VirtualBox

Changeset 70075 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Dec 12, 2017 9:54:21 AM (7 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
119623
Message:

Devices/Graphics, Main, FE/Qt: add plumbing for sending cursor position events.
bugref:9038: FE/Qt: better handle mouse cursor when toggling integration
The Linux and X11 graphics driver sends notification when the guest cursor
position changes. This could be used by the front-end to switch back to
pointer capturing without requiring that the guest draw the cursor, which
often results in artifacts. This change adds the necessary plumbing between
the graphics device and the user interface.

Location:
trunk/src/VBox
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Graphics/DevVGA_VBVA.cpp

    r69500 r70075  
    27372737                            RT_BOOL(pReport->fReportPosition), pReport->x, pReport->y));
    27382738
     2739            pVGAState->pDrv->pfnVBVAReportCursorPosition(pVGAState->pDrv, pReport->fReportPosition,
     2740                                                         pReport->x, pReport->y);
    27392741            pReport->x = pCtx->xCursor;
    27402742            pReport->y = pCtx->yCursor;
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UIMainEventListener.cpp

    r69500 r70075  
    6060# include "CProgressPercentageChangedEvent.h"
    6161# include "CProgressTaskCompletedEvent.h"
     62# include "CCursorPositionChangedEvent.h"
    6263#endif /* !VBOX_WITH_PRECOMPILED_HEADERS */
    6364
     
    418419            break;
    419420        }
     421        case KVBoxEventType_OnCursorPositionChanged:
     422        {
     423            CCursorPositionChangedEvent es(pEvent);
     424            emit sigCursorPositionChange(es.GetHasData(), (unsigned long)es.GetX(), (unsigned long)es.GetY());
     425            break;
     426        }
    420427
    421428        default: break;
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UIMainEventListener.h

    r69500 r70075  
    127127    void sigProgressTaskComplete(QString strProgressId);
    128128
     129    /** Notifies about guest requests to change the cursor position. If @a fData is not set this merely notifies that the guest supports this.  This notification must be sent after every screen configuration change. */
     130    void sigCursorPositionChange(bool fData, unsigned long X, unsigned long Y);
     131
    129132public:
    130133
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIConsoleEventHandler.cpp

    r69500 r70075  
    197197        << KVBoxEventType_OnCanShowWindow
    198198        << KVBoxEventType_OnShowWindow
    199         << KVBoxEventType_OnAudioAdapterChanged;
     199        << KVBoxEventType_OnAudioAdapterChanged
     200        << KVBoxEventType_OnCursorPositionChanged;
    200201
    201202    /* Register event listener for console event source: */
  • trunk/src/VBox/Main/idl/VirtualBox.xidl

    r69785 r70075  
    2226822268      </desc>
    2226922269    </const>
     22270    <const name="OnCursorPositionChanged" value="100">
     22271      <desc>
     22272        See <link to="ICursorPositionChangedEvent">ICursorPositionChangedEvent</link>.
     22273      </desc>
     22274    </const>
    2227022275    <!-- Last event marker -->
    22271     <const name="Last" value="100">
     22276    <const name="Last" value="101">
    2227222277      <desc>
    2227322278        Must be last event, used for iterations and structures relying on numerical event values.
     
    2434224347  </interface>
    2434324348
     24349  <interface
     24350    name="ICursorPositionChangedEvent" extends="IEvent"
     24351    uuid="6f302674-c927-11e7-b788-33c248e71fc7"
     24352    wsmap="managed" autogen="VBoxEvent" id="OnCursorPositionChanged">
     24353    <desc>The guest reports cursor position data.</desc>
     24354
     24355    <attribute name="hasData" readonly="yes" type="boolean">
     24356      <desc>Event contains valid data (alternative: notification of support)</desc>
     24357    </attribute>
     24358    <attribute name="x" readonly="yes" type="unsigned long">
     24359      <desc>Reported X position</desc>
     24360    </attribute>
     24361    <attribute name="y" readonly="yes" type="unsigned long">
     24362      <desc>Reported Y position</desc>
     24363    </attribute>
     24364  </interface>
     24365
    2434424366  <module name="VBoxSVC" context="LocalServer">
    2434524367    <class name="VirtualBox" uuid="B1A7A4F2-47B9-4A1E-82B2-07CCD5323C3F"
  • trunk/src/VBox/Main/include/DisplayImpl.h

    r70035 r70075  
    383383    static DECLCALLBACK(void)  i_displayVBVAInputMappingUpdate(PPDMIDISPLAYCONNECTOR pInterface, int32_t xOrigin, int32_t yOrigin,
    384384                                                               uint32_t cx, uint32_t cy);
     385    static DECLCALLBACK(void)  i_displayVBVAReportCursorPosition(PPDMIDISPLAYCONNECTOR pInterface, bool fData, uint32_t x, uint32_t y);
    385386#endif
    386387
  • trunk/src/VBox/Main/src-client/DisplayImpl.cpp

    r70039 r70075  
    45614561}
    45624562
     4563DECLCALLBACK(void) Display::i_displayVBVAReportCursorPosition(PPDMIDISPLAYCONNECTOR pInterface, bool fData, uint32_t x, uint32_t y)
     4564{
     4565    LogFlowFunc(("\n"));
     4566
     4567    PDRVMAINDISPLAY pDrv = PDMIDISPLAYCONNECTOR_2_MAINDISPLAY(pInterface);
     4568    Display *pThis = pDrv->pDisplay;
     4569
     4570    fireCursorPositionChangedEvent(pThis->mParent->i_getEventSource(), fData, x, y);
     4571}
     4572
    45634573#endif /* VBOX_WITH_HGSMI */
    45644574
     
    46634673    pThis->IConnector.pfnVBVAGuestCapabilityUpdate = Display::i_displayVBVAGuestCapabilityUpdate;
    46644674    pThis->IConnector.pfnVBVAInputMappingUpdate = Display::i_displayVBVAInputMappingUpdate;
     4675    pThis->IConnector.pfnVBVAReportCursorPosition = Display::i_displayVBVAReportCursorPosition;
    46654676#endif
    46664677
  • trunk/src/VBox/Runtime/VBox/log-vbox.cpp

    r69111 r70075  
    353353    ASSERT_LOG_GROUP(MAIN_CPUCHANGEDEVENT);
    354354    ASSERT_LOG_GROUP(MAIN_CPUEXECUTIONCAPCHANGEDEVENT);
     355    ASSERT_LOG_GROUP(MAIN_CURSORPOSITIONCHANGEDEVENT);
    355356    ASSERT_LOG_GROUP(MAIN_DHCPSERVER);
    356357    ASSERT_LOG_GROUP(MAIN_DIRECTORY);
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