VirtualBox

Changeset 41486 in vbox for trunk/src


Ignore:
Timestamp:
May 29, 2012 3:50:49 PM (13 years ago)
Author:
vboxsync
Message:

FE/Qt: 5820: Hide all VM windows except 1st (main) one when starting VM with no saved-state stored.

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

Legend:

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

    r41122 r41486  
    612612#endif /* VBOX_WITH_DEBUGGER_GUI */
    613613
     614bool UIMachineWindow::shouldWeShowWindow() const
     615{
     616    /* By default, every window should be shown: */
     617    bool fResult = true;
     618    /* But if machine is 'turned off': */
     619    if (uisession()->isTurnedOff())
     620    {
     621        /* If machine is in 'saved' state: */
     622        if (uisession()->isSaved())
     623        {
     624            /* We are getting shown-state from saved-state: */
     625            BOOL fEnabled = true;
     626            ULONG guestOriginX = 0, guestOriginY = 0, guestWidth = 0, guestHeight = 0;
     627            machine().QuerySavedGuestScreenInfo(m_uScreenId, guestOriginX, guestOriginY, guestWidth, guestHeight, fEnabled);
     628            fResult = fEnabled;
     629        }
     630        /* If machine is in 'powered off', 'teleported' or 'aborted' state: */
     631        else
     632        {
     633            /* Shown-state is 'enabled' only for 1st monitor: */
     634            fResult = m_uScreenId == 0;
     635        }
     636    }
     637    return fResult;
     638}
     639
    614640/* static */
    615641Qt::WindowFlags UIMachineWindow::windowFlags(UIVisualStateType visualStateType)
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineWindow.h

    r41122 r41486  
    109109
    110110    /* Helpers: */
     111    bool shouldWeShowWindow() const;
    111112    const QString& defaultWindowTitle() const { return m_strWindowTitlePrefix; }
    112113    static Qt::WindowFlags windowFlags(UIVisualStateType visualStateType);
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/fullscreen/UIMachineWindowFullscreen.cpp

    r41333 r41486  
    165165void UIMachineWindowFullscreen::showInNecessaryMode()
    166166{
    167     /* Make sure we really have to show window: */
    168     BOOL fEnabled = true;
    169     ULONG guestOriginX = 0, guestOriginY = 0, guestWidth = 0, guestHeight = 0;
    170     machine().QuerySavedGuestScreenInfo(m_uScreenId, guestOriginX, guestOriginY, guestWidth, guestHeight, fEnabled);
    171     if (fEnabled)
     167    /* Show window if we have to: */
     168    if (shouldWeShowWindow())
    172169    {
    173170        /* Make sure the window is placed on valid screen
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/normal/UIMachineWindowNormal.cpp

    r41333 r41486  
    505505void UIMachineWindowNormal::showInNecessaryMode()
    506506{
    507     /* Make sure we really have to show window: */
    508     BOOL fEnabled = true;
    509     ULONG guestOriginX = 0, guestOriginY = 0, guestWidth = 0, guestHeight = 0;
    510     machine().QuerySavedGuestScreenInfo(m_uScreenId, guestOriginX, guestOriginY, guestWidth, guestHeight, fEnabled);
    511     if (fEnabled)
     507    /* Show window if we have to: */
     508    if (shouldWeShowWindow())
    512509        show();
    513510}
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/scale/UIMachineWindowScale.cpp

    r41333 r41486  
    199199void UIMachineWindowScale::showInNecessaryMode()
    200200{
    201     /* Make sure we really have to show window: */
    202     BOOL fEnabled = true;
    203     ULONG guestOriginX = 0, guestOriginY = 0, guestWidth = 0, guestHeight = 0;
    204     machine().QuerySavedGuestScreenInfo(m_uScreenId, guestOriginX, guestOriginY, guestWidth, guestHeight, fEnabled);
    205     if (fEnabled)
     201    /* Show window if we have to: */
     202    if (shouldWeShowWindow())
    206203        show();
    207204}
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/seamless/UIMachineWindowSeamless.cpp

    r41334 r41486  
    219219void UIMachineWindowSeamless::showInNecessaryMode()
    220220{
    221     /* Make sure we really have to show window: */
    222     BOOL fEnabled = true;
    223     ULONG guestOriginX = 0, guestOriginY = 0, guestWidth = 0, guestHeight = 0;
    224     machine().QuerySavedGuestScreenInfo(m_uScreenId, guestOriginX, guestOriginY, guestWidth, guestHeight, fEnabled);
    225     if (fEnabled)
     221    /* Show window if we have to: */
     222    if (shouldWeShowWindow())
    226223    {
    227224        /* Show manually maximized window: */
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