VirtualBox

Ignore:
Timestamp:
Feb 21, 2014 7:19:56 AM (11 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
92384
Message:

FE/Qt: Runtime UI: Move multi-screen layout change handling logic into appropriate place.

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

Legend:

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

    r50522 r50535  
    227227    setPresentationModeEnabled(true);
    228228}
     229#endif /* Q_WS_MAC */
    229230
    230231void UIMachineLogicFullscreen::sltScreenLayoutChanged()
    231232{
    232     setPresentationModeEnabled(true);
    233 }
    234 #endif /* Q_WS_MAC */
     233    /* Update machine-window(s) location/size: */
     234    foreach (UIMachineWindow *pMachineWindow, machineWindows())
     235        pMachineWindow->showInNecessaryMode();
     236
     237#ifdef Q_WS_MAC
     238    /* Update 'presentation mode' for Lion and previous: */
     239    if (vboxGlobal().osRelease() <= MacOSXRelease_Lion)
     240        setPresentationModeEnabled(true);
     241#endif /* Q_WS_MAC */
     242}
    235243
    236244void UIMachineLogicFullscreen::sltGuestMonitorChange(KGuestMonitorChangedEventType changeType, ulong uScreenId, QRect screenGeo)
     
    307315        return;
    308316
    309 #ifdef Q_WS_MAC // TODO: Is that "darwinSetFrontMostProcess" really need here?
     317#ifdef Q_WS_MAC
    310318    /* We have to make sure that we are getting the front most process.
    311319     * This is necessary for Qt versions > 4.3.3: */
    312     ::darwinSetFrontMostProcess();
     320    darwinSetFrontMostProcess();
    313321#endif /* Q_WS_MAC */
    314322
     
    321329
    322330    /* Connect multi-screen layout change handler: */
    323     for (int i = 0; i < machineWindows().size(); ++i)
    324         connect(m_pScreenLayout, SIGNAL(sigScreenLayoutChanged()),
    325                 static_cast<UIMachineWindowFullscreen*>(machineWindows()[i]), SLOT(sltShowInNecessaryMode()));
    326 
    327 #ifdef Q_WS_MAC
    328     /* Make sure 'presentation mode' is enabled/updated for Lion and previous: */
    329     if (vboxGlobal().osRelease() <= MacOSXRelease_Lion)
    330     {
    331         connect(m_pScreenLayout, SIGNAL(sigScreenLayoutChanged()),
    332                 this, SLOT(sltScreenLayoutChanged()));
     331    connect(m_pScreenLayout, SIGNAL(sigScreenLayoutChanged()),
     332            this, SLOT(sltScreenLayoutChanged()));
     333
     334#ifdef Q_WS_MAC
     335    /* Activate 'presentation mode' for Lion and previous: */
     336    if (vboxGlobal().osRelease() <= MacOSXRelease_Lion)
    333337        setPresentationModeEnabled(true);
    334     }
    335 #endif /* Q_WS_MAC */
    336 
    337 #ifdef Q_WS_MAC
    338     /* On ML and later: */
    339     if (vboxGlobal().osRelease() > MacOSXRelease_Lion)
    340     {
     338    /* For ML and next: */
     339    else
     340    {
     341        /* For all the machine-window(s): */
    341342        foreach (UIMachineWindow *pMachineWindow, machineWindows())
    342343        {
    343             /* Keep sync for machine-logic/window(s): */
     344            /* Watch for native fullscreen signals: */
    344345            connect(pMachineWindow, SIGNAL(sigNotifyAboutNativeFullscreenDidEnter()),
    345346                    this, SLOT(sltHandleNativeFullscreenDidEnter()));
     
    347348                    this, SLOT(sltHandleNativeFullscreenDidExit()));
    348349            /* Enter native fullscreen mode: */
    349             if (darwinScreensHaveSeparateSpaces() || pMachineWindow->screenId() == 0)
    350                 if (!darwinIsInFullscreenMode(pMachineWindow))
    351                     darwinToggleFullscreenMode(pMachineWindow);
     350            if (   (darwinScreensHaveSeparateSpaces() || pMachineWindow->screenId() == 0)
     351                && !darwinIsInFullscreenMode(pMachineWindow))
     352                darwinToggleFullscreenMode(pMachineWindow);
    352353        }
    353354    }
     
    377378    setMachineWindowsCreated(false);
    378379
    379 #ifdef Q_WS_MAC
    380     /* On ML and later: */
    381     if (vboxGlobal().osRelease() > MacOSXRelease_Lion)
    382     {
    383         foreach (UIMachineWindow *pMachineWindow, machineWindows())
    384         {
    385             /* Leave sync for machine-logic/window(s): */
    386             disconnect(pMachineWindow, SIGNAL(sigNotifyAboutNativeFullscreenDidEnter()),
    387                        this, SLOT(sltHandleNativeFullscreenDidEnter()));
    388             disconnect(pMachineWindow, SIGNAL(sigNotifyAboutNativeFullscreenDidExit()),
    389                        this, SLOT(sltHandleNativeFullscreenDidExit()));
    390         }
    391     }
    392 #endif/* Q_WS_MAC */
    393 
    394     /* Cleanup machine-window(s): */
     380    /* Destroy machine-window(s): */
    395381    foreach (UIMachineWindow *pMachineWindow, machineWindows())
    396382        UIMachineWindow::destroy(pMachineWindow);
    397383
    398384#ifdef Q_WS_MAC
    399     /* Make sure 'presentation mode' is disabled for Lion and previous: */
     385    /* Deactivate 'presentation mode' for Lion and previous: */
    400386    if (vboxGlobal().osRelease() <= MacOSXRelease_Lion)
    401387        setPresentationModeEnabled(false);
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/fullscreen/UIMachineLogicFullscreen.h

    r50498 r50535  
    6565#ifdef Q_WS_MAC
    6666    void sltChangePresentationMode(bool fEnabled);
     67#endif /* Q_WS_MAC */
     68
     69    /** Updates machine-window(s) location/size on screen-layout changes. */
    6770    void sltScreenLayoutChanged();
    68 #endif /* Q_WS_MAC */
     71
    6972    void sltGuestMonitorChange(KGuestMonitorChangedEventType changeType, ulong uScreenId, QRect screenGeo);
    7073    void sltHostScreenCountChanged();
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/fullscreen/UIMachineWindowFullscreen.h

    r50522 r50535  
    5454    void sltMachineStateChanged();
    5555
    56     /* Show in necessary mode: */
    57     void sltShowInNecessaryMode() { showInNecessaryMode(); }
    58 
    5956    /* Popup main-menu: */
    6057    void sltPopupMainMenu();
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/seamless/UIMachineLogicSeamless.cpp

    r50490 r50535  
    146146}
    147147
     148void UIMachineLogicSeamless::sltScreenLayoutChanged()
     149{
     150    /* Update machine-window(s) location/size: */
     151    foreach (UIMachineWindow *pMachineWindow, machineWindows())
     152        pMachineWindow->showInNecessaryMode();
     153}
     154
    148155void UIMachineLogicSeamless::sltGuestMonitorChange(KGuestMonitorChangedEventType changeType, ulong uScreenId, QRect screenGeo)
    149156{
     
    213220        return;
    214221
    215 #ifdef Q_WS_MAC // TODO: Is that really need here?
     222#ifdef Q_WS_MAC
    216223    /* We have to make sure that we are getting the front most process.
    217224     * This is necessary for Qt versions > 4.3.3: */
    218     ::darwinSetFrontMostProcess();
     225    darwinSetFrontMostProcess();
    219226#endif /* Q_WS_MAC */
    220227
     
    222229    m_pScreenLayout->update();
    223230
    224     /* Create machine window(s): */
     231    /* Create machine-window(s): */
    225232    for (uint cScreenId = 0; cScreenId < session().GetMachine().GetMonitorCount(); ++cScreenId)
    226233        addMachineWindow(UIMachineWindow::create(this, cScreenId));
    227234
    228235    /* Connect multi-screen layout change handler: */
    229     for (int i = 0; i < machineWindows().size(); ++i)
    230         connect(m_pScreenLayout, SIGNAL(sigScreenLayoutChanged()),
    231                 static_cast<UIMachineWindowSeamless*>(machineWindows()[i]), SLOT(sltShowInNecessaryMode()));
     236    connect(m_pScreenLayout, SIGNAL(sigScreenLayoutChanged()),
     237            this, SLOT(sltScreenLayoutChanged()));
    232238
    233239    /* Mark machine-window(s) created: */
     
    254260    setMachineWindowsCreated(false);
    255261
    256     /* Cleanup machine-window(s): */
     262    /* Destroy machine-window(s): */
    257263    foreach (UIMachineWindow *pMachineWindow, machineWindows())
    258264        UIMachineWindow::destroy(pMachineWindow);
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/seamless/UIMachineLogicSeamless.h

    r49506 r50535  
    5454    void sltMachineStateChanged();
    5555
     56    /** Updates machine-window(s) location/size on screen-layout changes. */
     57    void sltScreenLayoutChanged();
     58
    5659    void sltGuestMonitorChange(KGuestMonitorChangedEventType changeType, ulong uScreenId, QRect screenGeo);
    5760    void sltHostScreenCountChanged();
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/seamless/UIMachineWindowSeamless.h

    r48705 r50535  
    4242    void sltMachineStateChanged();
    4343#endif /* !Q_WS_MAC */
    44 
    45     /* Show in necessary mode: */
    46     void sltShowInNecessaryMode() { showInNecessaryMode(); }
    4744
    4845    /* Popup main menu: */
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