VirtualBox

Changeset 61720 in vbox for trunk


Ignore:
Timestamp:
Jun 15, 2016 2:24:41 PM (9 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
108089
Message:

FE/Qt: bugref:8422: Runtime UI: Full-screen window: Splitting the showInNecessaryMode() code into usual platform threads.

File:
1 edited

Legend:

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

    r61663 r61720  
    414414    AssertPtrReturnVoid(pFullscreenLogic);
    415415
    416     /* Make sure window should be shown and mapped to some host-screen: */
     416#if defined(VBOX_WS_MAC)
     417
     418    /* If window shouldn't be shown or mapped to some host-screen: */
    417419    if (!uisession()->isScreenVisible(m_uScreenId) ||
    418420        !pFullscreenLogic->hasHostScreenForGuestScreen(m_uScreenId))
    419421    {
    420         /* Remember whether the window was minimized: */
    421         if (isMinimized())
    422             m_fWasMinimized = true;
    423         /* Hide window and reset it's state to NONE: */
    424         setWindowState(Qt::WindowNoState);
     422        /* Hide window: */
    425423        hide();
    426 #if defined(VBOX_WS_WIN) || defined(VBOX_WS_X11)
    427         /* If there is mini-toolbar: */
    428         if (m_pMiniToolBar)
    429         {
    430             /* Hide mini-toolbar and reset it's state to NONE: */
    431             m_pMiniToolBar->setWindowState(Qt::WindowNoState);
    432             m_pMiniToolBar->hide();
    433         }
    434 #endif /* VBOX_WS_WIN || VBOX_WS_X11 */
    435     }
     424    }
     425    /* If window should be shown and mapped to some host-screen: */
    436426    else
    437427    {
    438         /* Ignore if window is minimized and visible: */
    439         if (isMinimized() && isVisible())
    440             return;
    441 
    442 #ifdef VBOX_WS_X11
    443         /* If WM doesn't support native stuff, we need to call for placeOnScreen(): */
    444         const bool fSupportsNativeFullScreen = VBoxGlobal::supportsFullScreenMonitorsProtocolX11() &&
    445                                                !gEDataManager->legacyFullscreenModeRequested();
    446         if (!fSupportsNativeFullScreen)
    447         {
    448             /* Make sure window have appropriate geometry: */
    449             placeOnScreen();
    450         }
    451 #else /* !VBOX_WS_X11 */
    452428        /* Make sure window have appropriate geometry: */
    453429        placeOnScreen();
    454 #endif /* !VBOX_WS_X11 */
    455 
    456 #if defined(VBOX_WS_MAC)
     430
    457431        /* ML and next using native stuff, so we can call for simple show(),
    458432         * Lion and previous using Qt stuff, so we should call for showFullScreen(): */
     
    468442            showFullScreen();
    469443        }
    470 #elif defined(VBOX_WS_WIN) || defined(VBOX_WS_X11)
     444
     445        /* Adjust machine-view size if necessary: */
     446        adjustMachineViewSize();
     447
     448        /* Make sure machine-view have focus: */
     449        m_pMachineView->setFocus();
     450    }
     451
     452#elif defined(VBOX_WS_WIN)
     453
     454    /* If window shouldn't be shown or mapped to some host-screen: */
     455    if (!uisession()->isScreenVisible(m_uScreenId) ||
     456        !pFullscreenLogic->hasHostScreenForGuestScreen(m_uScreenId))
     457    {
     458        /* Remember whether the window was minimized: */
     459        if (isMinimized())
     460            m_fWasMinimized = true;
     461
     462        /* Hide window and reset it's state to NONE: */
     463        setWindowState(Qt::WindowNoState);
     464        hide();
     465
    471466        /* If there is mini-toolbar: */
    472467        if (m_pMiniToolBar)
    473468        {
     469            /* Hide mini-toolbar and reset it's state to NONE: */
     470            m_pMiniToolBar->setWindowState(Qt::WindowNoState);
     471            m_pMiniToolBar->hide();
     472        }
     473    }
     474    /* If window should be shown and mapped to some host-screen: */
     475    else
     476    {
     477        /* Ignore if window is minimized and visible: */
     478        if (isMinimized() && isVisible())
     479            return;
     480
     481        /* Make sure window have appropriate geometry: */
     482        placeOnScreen();
     483
     484        /* If there is mini-toolbar: */
     485        if (m_pMiniToolBar)
     486        {
    474487            /* Show mini-toolbar: */
    475488            m_pMiniToolBar->showFullScreen();
    476489        }
     490
    477491        /* Show window: */
    478492        showFullScreen();
     493
    479494        /* Restore minimized state if necessary: */
    480495        if (m_fWasMinimized)
     
    483498            showMinimized();
    484499        }
    485 #endif /* VBOX_WS_WIN || VBOX_WS_X11 */
    486 
    487 #ifdef VBOX_WS_X11
     500
     501        /* Adjust machine-view size if necessary: */
     502        adjustMachineViewSize();
     503
     504        /* Make sure machine-view have focus: */
     505        m_pMachineView->setFocus();
     506    }
     507
     508#elif defined(VBOX_WS_X11)
     509
     510    /* If window shouldn't be shown or mapped to some host-screen: */
     511    if (!uisession()->isScreenVisible(m_uScreenId) ||
     512        !pFullscreenLogic->hasHostScreenForGuestScreen(m_uScreenId))
     513    {
     514        /* Remember whether the window was minimized: */
     515        if (isMinimized())
     516            m_fWasMinimized = true;
     517
     518        /* Hide window and reset it's state to NONE: */
     519        setWindowState(Qt::WindowNoState);
     520        hide();
     521
     522        /* If there is mini-toolbar: */
     523        if (m_pMiniToolBar)
     524        {
     525            /* Hide mini-toolbar and reset it's state to NONE: */
     526            m_pMiniToolBar->setWindowState(Qt::WindowNoState);
     527            m_pMiniToolBar->hide();
     528        }
     529    }
     530    /* If window should be shown and mapped to some host-screen: */
     531    else
     532    {
     533        /* Ignore if window is minimized and visible: */
     534        if (isMinimized() && isVisible())
     535            return;
     536
     537        /* If WM doesn't support native stuff, we need to call for placeOnScreen(): */
     538        const bool fUseNativeFullScreen = VBoxGlobal::supportsFullScreenMonitorsProtocolX11() &&
     539                                          !gEDataManager->legacyFullscreenModeRequested();
     540        if (!fUseNativeFullScreen)
     541        {
     542            /* Make sure window have appropriate geometry: */
     543            placeOnScreen();
     544        }
     545
     546        /* Show window: */
     547        showFullScreen();
     548
     549        /* If there is mini-toolbar: */
     550        if (m_pMiniToolBar)
     551        {
     552            /* Show mini-toolbar: */
     553            m_pMiniToolBar->showFullScreen();
     554        }
     555
     556        /* Restore minimized state if necessary: */
     557        if (m_fWasMinimized)
     558        {
     559            m_fWasMinimized = false;
     560            showMinimized();
     561        }
     562
    488563        /* If WM supports native stuff, we need to map window to corresponding host-screen. */
    489         if (fSupportsNativeFullScreen)
     564        if (fUseNativeFullScreen)
    490565        {
    491566            /* Tell recent window managers which host-screen this window should be mapped to: */
     
    499574            }
    500575        }
    501 #endif /* VBOX_WS_X11 */
    502576
    503577        /* Adjust machine-view size if necessary: */
     
    507581        m_pMachineView->setFocus();
    508582    }
     583
     584#else
     585
     586# warning "port me"
     587
     588#endif
    509589}
    510590
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