VirtualBox

Ignore:
Timestamp:
Feb 26, 2014 10:16:51 AM (11 years ago)
Author:
vboxsync
Message:

FE/Qt: Mac OS X: 7016: Native fullscreen multi-screen support: Using 'presentation mode' for better user experience. That fixes menu-bar flicker on secondary host-display. That also fixes issue with shifting 2nd screen in most of cases.

File:
1 edited

Legend:

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

    r50573 r50598  
    143143        if (m_fIsFullscreenInvalidated)
    144144        {
    145             /* Mark fullscreen mode valid again and re-enter it: */
    146145            LogRel(("UIMachineLogicFullscreen::sltHandleNativeFullscreenDidExit: "
    147146                    "Machine-window(s) exited invalidated fullscreen, enter again...\n"));
     147
     148            /* Mark fullscreen mode valid again: */
    148149            m_fIsFullscreenInvalidated = false;
     150            /* Reactivate 'presentation mode': */
     151            setPresentationModeEnabled(true);
     152            /* Re-enter fullscreen mode: */
    149153            foreach (UIMachineWindow *pMachineWindow, machineWindows())
    150154                pMachineWindow->showInNecessaryMode();
     
    158162        else
    159163        {
    160             /* Change visual-state to requested: */
    161164            LogRel(("UIMachineLogicFullscreen::sltHandleNativeFullscreenDidExit: "
    162165                    "Machine-window(s) exited fullscreen, changing visual-state to requested...\n"));
     166
     167            /* Change visual-state to requested: */
    163168            UIVisualStateType type = uisession()->requestedVisualState();
    164169            if (type == UIVisualStateType_Invalid)
     
    348353void UIMachineLogicFullscreen::prepareOtherConnections()
    349354{
    350     /* Make sure 'presentation mode' is updated for Lion and previous: */
     355    /* Make sure 'presentation mode' preference handling
     356     * is updated at runtime for Lion and previous: */
    351357    if (vboxGlobal().osRelease() <= MacOSXRelease_Lion)
    352358        connect(gEDataEvents, SIGNAL(sigPresentationModeChange(bool)),
     
    379385
    380386#ifdef Q_WS_MAC
    381     /* Activate 'presentation mode' for Lion and previous: */
    382     if (vboxGlobal().osRelease() <= MacOSXRelease_Lion)
    383         setPresentationModeEnabled(true);
     387    /* Activate 'presentation mode': */
     388    setPresentationModeEnabled(true);
    384389    /* For ML and next: */
    385     else
     390    if (vboxGlobal().osRelease() > MacOSXRelease_Lion)
    386391    {
    387392        /* For all the machine-window(s): */
     
    429434
    430435#ifdef Q_WS_MAC
    431     /* Deactivate 'presentation mode' for Lion and previous: */
    432     if (vboxGlobal().osRelease() <= MacOSXRelease_Lion)
    433         setPresentationModeEnabled(false);
     436    /* Deactivate 'presentation mode': */
     437    setPresentationModeEnabled(false);
    434438#endif/* Q_WS_MAC */
    435439}
     
    471475void UIMachineLogicFullscreen::setPresentationModeEnabled(bool fEnabled)
    472476{
    473     /* Make sure this method is only used for Lion and previous: */
    474     AssertReturnVoid(vboxGlobal().osRelease() <= MacOSXRelease_Lion);
    475 
    476     /* First check if we are on a screen which contains the Dock or the
    477      * Menubar (which hasn't to be the same), only than the
    478      * presentation mode have to be changed. */
    479     if (   fEnabled
    480         && m_pScreenLayout->isHostTaskbarCovert())
    481     {
    482         QString testStr = vboxGlobal().virtualBox().GetExtraData(GUI_PresentationModeEnabled).toLower();
    483         /* Default to false if it is an empty value */
    484         if (testStr.isEmpty() || testStr == "false")
    485             SetSystemUIMode(kUIModeAllHidden, 0);
     477    /* Should we enable it? */
     478    if (fEnabled)
     479    {
     480        /* For Lion and previous: */
     481        if (vboxGlobal().osRelease() <= MacOSXRelease_Lion)
     482        {
     483            /* Check if we have screen which contains the Dock or the Menubar (which hasn't to be the same),
     484             * only than the 'presentation mode' have to be changed. */
     485            if (m_pScreenLayout->isHostTaskbarCovert())
     486            {
     487                /* Load 'presentation mode' preference: */
     488                QString strPresentationMode = vboxGlobal().virtualBox().GetExtraData(GUI_PresentationModeEnabled).toLower();
     489                /* Default to 'false' if it is an empty value: */
     490                if (strPresentationMode.isEmpty() || strPresentationMode == "false")
     491                    SetSystemUIMode(kUIModeAllHidden, 0);
     492                else
     493                    SetSystemUIMode(kUIModeAllSuppressed, 0);
     494            }
     495        }
     496        /* For ML and next: */
    486497        else
     498        {
     499            /* I am not sure we have to check anything here.
     500             * Without 'presentation mode' native fullscreen works pretty bad,
     501             * so we have to enable it anyway: */
    487502            SetSystemUIMode(kUIModeAllSuppressed, 0);
    488     }
    489     else
    490         SetSystemUIMode(kUIModeNormal, 0);
     503        }
     504    }
     505    /* Should we disable it? */
     506    else SetSystemUIMode(kUIModeNormal, 0);
    491507}
    492508
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