VirtualBox

Changeset 52299 in vbox for trunk/src/VBox/Frontends


Ignore:
Timestamp:
Aug 6, 2014 4:56:26 PM (10 years ago)
Author:
vboxsync
Message:

FE/Qt: Mac OS X: Runtime UI: Cache 'screens have separate spaces' value in machine-logic.

Location:
trunk/src/VBox/Frontends/VirtualBox/src/runtime/fullscreen
Files:
3 edited

Legend:

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

    r52275 r52299  
    4242    , m_pPopupMenu(0)
    4343#ifdef Q_WS_MAC
    44     , m_fadeToken(kCGDisplayFadeReservationInvalidToken)
     44    , m_fScreensHaveSeparateSpaces(darwinScreensHaveSeparateSpaces())
    4545#endif /* Q_WS_MAC */
    4646{
     
    144144            && hasHostScreenForGuestScreen(pMachineWindow->screenId()))
    145145            visibleMachineWindows << pMachineWindow;
    146     if (   !darwinScreensHaveSeparateSpaces()
     146    if (   !screensHaveSeparateSpaces()
    147147        || m_fullscreenMachineWindows == visibleMachineWindows)
    148148        fadeToNormal();
     
    722722
    723723    /* Validate window which can't be fullscreen: */
    724     if (uScreenID != 0 && !darwinScreensHaveSeparateSpaces())
     724    if (uScreenID != 0 && !screensHaveSeparateSpaces())
    725725    {
    726726        LogRel(("UIMachineLogicFullscreen::revalidateNativeFullScreen: "
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/fullscreen/UIMachineLogicFullscreen.h

    r52298 r52299  
    3636#ifdef RT_OS_DARWIN
    3737signals:
     38
    3839    /** Mac OS X: Notifies listeners about native fullscreen mode should be entered on @a pMachineWindow. */
    3940    void sigNotifyAboutNativeFullscreenShouldBeEntered(UIMachineWindow *pMachineWindow = 0);
     
    4142    void sigNotifyAboutNativeFullscreenShouldBeExited(UIMachineWindow *pMachineWindow = 0);
    4243#endif /* RT_OS_DARWIN */
     44
     45#ifdef Q_WS_MAC
     46public:
     47
     48    /** Returns whether screens have separate spaces. */
     49    bool screensHaveSeparateSpaces() const { return m_fScreensHaveSeparateSpaces; }
     50#endif /* Q_WS_MAC */
    4351
    4452protected:
     
    9098    void sltInvokePopupMenu();
    9199
    92 #ifdef Q_WS_MAC
     100#ifdef RT_OS_DARWIN
    93101    void sltChangePresentationMode(bool fEnabled);
    94 #endif /* Q_WS_MAC */
     102#endif /* RT_OS_DARWIN */
    95103
    96104    /** Updates machine-window(s) location/size on screen-layout changes. */
     
    145153
    146154#ifdef Q_WS_MAC
     155    /** Mac OS X: Holds whether screens have separate spaces. */
     156    const bool m_fScreensHaveSeparateSpaces;
     157
    147158    /** Mac OS X: Fade token. */
    148159    CGDisplayFadeReservationToken m_fadeToken;
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/fullscreen/UIMachineWindowFullscreen.cpp

    r52202 r52299  
    129129    /* Make sure this window has fullscreen logic: */
    130130    UIMachineLogicFullscreen *pFullscreenLogic = qobject_cast<UIMachineLogicFullscreen*>(machineLogic());
    131     if (!pFullscreenLogic)
    132         return;
     131    AssertPtrReturnVoid(pFullscreenLogic);
    133132
    134133    /* Make sure this window mapped to some host-screen: */
     
    140139
    141140    /* Enter native fullscreen mode if necessary: */
    142     if (   (darwinScreensHaveSeparateSpaces() || m_uScreenId == 0)
     141    if (   (pFullscreenLogic->screensHaveSeparateSpaces() || m_uScreenId == 0)
    143142        && !darwinIsInFullscreenMode(this))
    144143        darwinToggleFullscreenMode(this);
     
    154153        return;
    155154
     155    /* Make sure this window has fullscreen logic: */
     156    UIMachineLogicFullscreen *pFullscreenLogic = qobject_cast<UIMachineLogicFullscreen*>(machineLogic());
     157    AssertPtrReturnVoid(pFullscreenLogic);
     158
    156159    /* Mark window 'transitioned from fullscreen': */
    157160    m_fIsInFullscreenTransition = true;
    158161
    159162    /* Exit native fullscreen mode if necessary: */
    160     if (   (darwinScreensHaveSeparateSpaces() || m_uScreenId == 0)
     163    if (   (pFullscreenLogic->screensHaveSeparateSpaces() || m_uScreenId == 0)
    161164        && darwinIsInFullscreenMode(this))
    162165        darwinToggleFullscreenMode(this);
     
    189192    if (vboxGlobal().osRelease() > MacOSXRelease_Lion)
    190193    {
     194        /* Make sure this window has fullscreen logic: */
     195        UIMachineLogicFullscreen *pFullscreenLogic = qobject_cast<UIMachineLogicFullscreen*>(machineLogic());
     196        AssertPtrReturnVoid(pFullscreenLogic);
    191197        /* Enable fullscreen support for every screen which requires it: */
    192         if (darwinScreensHaveSeparateSpaces() || m_uScreenId == 0)
     198        if (pFullscreenLogic->screensHaveSeparateSpaces() || m_uScreenId == 0)
    193199            darwinEnableFullscreenSupport(this);
    194200        /* Enable transience support for other screens: */
     
    276282    move(workingArea.topLeft());
    277283#ifdef Q_WS_MAC
     284    /* Make sure this window has fullscreen logic: */
     285    UIMachineLogicFullscreen *pFullscreenLogic = qobject_cast<UIMachineLogicFullscreen*>(machineLogic());
     286    AssertPtrReturnVoid(pFullscreenLogic);
    278287    /* Resize to the appropriate size on Lion and previous: */
    279288    if (vboxGlobal().osRelease() <= MacOSXRelease_Lion)
     
    281290    /* Resize to the appropriate size on ML and next
    282291     * only if that screen has no own user-space: */
    283     else if (!darwinScreensHaveSeparateSpaces() && m_uScreenId != 0)
     292    else if (!pFullscreenLogic->screensHaveSeparateSpaces() && m_uScreenId != 0)
    284293        resize(workingArea.size());
    285294#else /* !Q_WS_MAC */
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