VirtualBox

Changeset 27379 in vbox


Ignore:
Timestamp:
Mar 15, 2010 6:30:56 PM (15 years ago)
Author:
vboxsync
Message:

FE/Qt4: New running VM core: improve f/s mode-switching stability.

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

Legend:

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

    r27335 r27379  
    277277public:
    278278
    279     UIMachineViewBlocker(QObject *pWatchedObject)
     279    UIMachineViewBlocker()
    280280        : QEventLoop(0)
    281281        , m_iTimerId(0)
    282282    {
    283         /* Install object event watcher: */
    284         pWatchedObject->installEventFilter(this);
    285 
    286283        /* Also start timer to unlock pool in case of
    287284         * required condition doesn't happens by some reason: */
     
    296293
    297294protected:
    298 
    299     bool eventFilter(QObject *pWatched, QEvent *pEvent)
    300     {
    301         switch (pEvent->type())
    302         {
    303             case VBoxDefs::ResizeEventType:
    304             {
    305                 /* Its a specific part related to fullscreen/seamless modes.
    306                  * Here we are waiting for guest resize event to be sure what
    307                  * non-normal modes successfully restored previous guest size hint.
    308                  * And we just unlocking the 'this' blocker afterwards: */
    309                 exit();
    310                 return false;
    311             }
    312             default:
    313                 break;
    314         }
    315         return QEventLoop::eventFilter(pWatched, pEvent);
    316     }
    317295
    318296    void timerEvent(QTimerEvent *pEvent)
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/fullscreen/UIMachineViewFullscreen.cpp

    r27377 r27379  
    5656    , m_bIsGuestAutoresizeEnabled(pMachineWindow->machineLogic()->actionsPool()->action(UIActionIndex_Toggle_GuestAutoresize)->isChecked())
    5757    , m_fShouldWeDoResize(false)
     58    , m_pSyncBlocker(0)
    5859{
    5960    /* Load machine view settings: */
     
    7172    /* Prepare console connections: */
    7273    prepareConsoleConnections();
     74
     75    /* Prepare fullscreen: */
     76    prepareFullscreen();
    7377
    7478    /* Initialization: */
     
    162166                    pEvent->ignore();
    163167            }
     168        }
     169
     170        case VBoxDefs::ResizeEventType:
     171        {
     172            bool fResult = UIMachineView::event(pEvent);
     173            if (m_pSyncBlocker && m_pSyncBlocker->isRunning())
     174                m_pSyncBlocker->quit();
     175            return fResult;
    164176        }
    165177        default:
     
    238250}
    239251
     252void UIMachineViewFullscreen::prepareFullscreen()
     253{
     254    /* Create sync-blocker: */
     255    m_pSyncBlocker = new UIMachineViewBlocker;
     256}
     257
    240258void UIMachineViewFullscreen::cleanupFullscreen()
    241259{
     
    246264        if (m_bIsGuestAutoresizeEnabled && uisession()->isGuestSupportsGraphics())
    247265        {
    248             /* Rollback fullscreen frame-buffer size to normal: */
    249             UIMachineViewBlocker blocker(this);
     266            /* Rollback seamless frame-buffer size to normal: */
     267            machineWindowWrapper()->machineWindow()->hide();
    250268            sltPerformGuestResize(guestSizeHint());
    251             blocker.exec();
     269            m_pSyncBlocker->exec();
     270
     271            /* Request to delete sync-blocker: */
     272            m_pSyncBlocker->deleteLater();
    252273        }
    253274    }
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/fullscreen/UIMachineViewFullscreen.h

    r27335 r27379  
    6464    void prepareConnections();
    6565    void prepareConsoleConnections();
    66     //void prepareFullscreen() {}
     66    void prepareFullscreen();
    6767
    6868    /* Cleanup routines: */
     
    8282    void maybeRestrictMinimumSize();
    8383
    84     /* Private members: */
     84    /* Private variables: */
    8585    bool m_bIsGuestAutoresizeEnabled : 1;
    8686    bool m_fShouldWeDoResize : 1;
     87    UIMachineViewBlocker *m_pSyncBlocker;
    8788
    8889    /* Friend classes: */
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/seamless/UIMachineViewSeamless.cpp

    r27377 r27379  
    5454                    , uMonitor)
    5555    , m_fShouldWeDoResize(false)
     56    , m_pSyncBlocker(0)
    5657{
    5758    /* Load machine view settings: */
     
    176177                    pEvent->ignore();
    177178            }
     179        }
     180
     181        case VBoxDefs::ResizeEventType:
     182        {
     183            bool fResult = UIMachineView::event(pEvent);
     184            if (m_pSyncBlocker && m_pSyncBlocker->isRunning())
     185                m_pSyncBlocker->quit();
     186            return fResult;
     187            break;
    178188        }
    179189        default:
     
    256266    /* Set seamless feature flag to the guest: */
    257267    session().GetConsole().GetDisplay().SetSeamlessMode(true);
     268    /* Create sync-blocker: */
     269    m_pSyncBlocker = new UIMachineViewBlocker;
    258270}
    259271
     
    267279
    268280        /* Rollback seamless frame-buffer size to normal: */
    269         UIMachineViewBlocker blocker(this);
     281        machineWindowWrapper()->machineWindow()->hide();
    270282        sltPerformGuestResize(guestSizeHint());
    271         blocker.exec();
     283        m_pSyncBlocker->exec();
     284
     285        /* Delete sync-blocker: */
     286        m_pSyncBlocker->deleteLater();
    272287    }
    273288}
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/seamless/UIMachineViewSeamless.h

    r27335 r27379  
    8383    bool m_fShouldWeDoResize : 1;
    8484    QRegion m_lastVisibleRegion;
     85    UIMachineViewBlocker *m_pSyncBlocker;
    8586
    8687    /* Friend classes: */
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