VirtualBox

Changeset 90705 in vbox


Ignore:
Timestamp:
Aug 17, 2021 4:48:16 PM (4 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
146325
Message:

FE/Qt: bugref:8161: Runtime UI / UIMachineView: Stop all DnD related updates before detaching COM stuff.

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

Legend:

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

    r88678 r90705  
    148148    pMachineView->prepareCommon();
    149149
     150#ifdef VBOX_WITH_DRAG_AND_DROP
     151    /* Prepare DnD: */
     152    pMachineView->prepareDnd();
     153#endif
     154
    150155    /* Prepare event-filters: */
    151156    pMachineView->prepareFilters();
     
    180185        return;
    181186
     187#ifdef VBOX_WITH_DRAG_AND_DROP
     188    /* Cleanup DnD: */
     189    pMachineView->cleanupDnd();
     190#endif
     191
    182192    /* Cleanup frame-buffer: */
    183193    pMachineView->cleanupFrameBuffer();
    184 
    185 #ifdef VBOX_WITH_DRAG_AND_DROP
    186     if (pMachineView->m_pDnDHandler)
    187     {
    188         delete pMachineView->m_pDnDHandler;
    189         pMachineView->m_pDnDHandler = NULL;
    190     }
    191 #endif
    192194
    193195    /* Cleanup native filters: */
     
    790792}
    791793
     794void UIMachineView::sltDetachCOM()
     795{
     796#ifdef VBOX_WITH_DRAG_AND_DROP
     797    /* Cleanup DnD: */
     798    cleanupDnd();
     799#endif
     800}
     801
    792802UIMachineView::UIMachineView(UIMachineWindow *pMachineWindow, ulong uScreenId)
    793803    : QAbstractScrollArea(pMachineWindow->centralWidget())
     
    949959    /* Setup focus policy: */
    950960    setFocusPolicy(Qt::WheelFocus);
     961}
    951962
    952963#ifdef VBOX_WITH_DRAG_AND_DROP
     964void UIMachineView::prepareDnd()
     965{
    953966    /* Enable drag & drop: */
    954967    setAcceptDrops(true);
     
    956969    /* Create the drag and drop handler instance: */
    957970    m_pDnDHandler = new UIDnDHandler(uisession(), this /* pParent */);
     971}
    958972#endif /* VBOX_WITH_DRAG_AND_DROP */
    959 }
    960973
    961974void UIMachineView::prepareFilters()
     
    977990void UIMachineView::prepareConnections()
    978991{
     992    /* UICommon connections: */
     993    connect(&uiCommon(), &UICommon::sigAskToDetachCOM, this, &UIMachineView::sltDetachCOM);
    979994    /* Desktop resolution change (e.g. monitor hotplug): */
    980995    connect(gpDesktop, &UIDesktopWidgetWatchdog::sigHostScreenResized,
     
    10041019    connect(uisession(), &UISession::sigMousePointerShapeChange, this, &UIMachineView::sltMousePointerShapeChange);
    10051020}
     1021
     1022#ifdef VBOX_WITH_DRAG_AND_DROP
     1023void UIMachineView::cleanupDnd()
     1024{
     1025    delete m_pDnDHandler;
     1026    m_pDnDHandler = 0;
     1027}
     1028#endif /* VBOX_WITH_DRAG_AND_DROP */
    10061029
    10071030void UIMachineView::cleanupFrameBuffer()
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineView.h

    r88678 r90705  
    153153    void sltMousePointerShapeChange();
    154154
     155    /** Detaches COM. */
     156    void sltDetachCOM();
     157
    155158protected:
    156159
     
    166169    virtual void prepareFrameBuffer();
    167170    virtual void prepareCommon();
     171#ifdef VBOX_WITH_DRAG_AND_DROP
     172    virtual void prepareDnd();
     173#endif
    168174    virtual void prepareFilters();
    169175    virtual void prepareConnections();
     
    174180    //virtual void cleanupConnections() {}
    175181    //virtual void cleanupFilters() {}
     182#ifdef VBOX_WITH_DRAG_AND_DROP
     183    virtual void cleanupDnd();
     184#endif
    176185    //virtual void cleanupCommon() {}
    177186    virtual void cleanupFrameBuffer();
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