VirtualBox

Changeset 48892 in vbox for trunk


Ignore:
Timestamp:
Oct 4, 2013 5:38:17 PM (11 years ago)
Author:
vboxsync
Message:

FE/Qt: 6982: Runtime UI: Guest-screen auto-pilot feature: Make sure disabled guest-screen re-enabled with previous resolution.

File:
1 edited

Legend:

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

    r48503 r48892  
    2828#include "UIActionPoolRuntime.h"
    2929#include "UIMachineLogic.h"
     30#include "UIFrameBuffer.h"
    3031#include "UISession.h"
    3132#include "UIMessageCenter.h"
     
    160161        /* We have to try to enable disabled guest-screens if any: */
    161162        int cGuestScreensToEnable = qMin(cExcessiveHostScreens, cDisabledGuestScreens);
     163        UISession *pSession = m_pMachineLogic->uisession();
    162164        for (int iGuestScreenIndex = 0; iGuestScreenIndex < cGuestScreensToEnable; ++iGuestScreenIndex)
    163165        {
    164             /* Get corresponding guest-screen: */
     166            /* Defaults: */
     167            ULONG uWidth = 800;
     168            ULONG uHeight = 600;
     169            /* Try to get previous guest-screen arguments: */
    165170            int iGuestScreen = m_disabledGuestScreens[iGuestScreenIndex];
    166             /* Re-enable guest-screen with 'default' arguments: */
    167             LogRelFlow(("UIMultiScreenLayout::update: Enabling guest-screen %d.\n", iGuestScreen));
    168             display.SetVideoModeHint(iGuestScreen, true, false, 0, 0, 800, 600, 32);
     171            if (UIFrameBuffer *pFrameBuffer = pSession->frameBuffer(iGuestScreen))
     172            {
     173                if (pFrameBuffer->width() > 0)
     174                    uWidth = pFrameBuffer->width();
     175                if (pFrameBuffer->height() > 0)
     176                    uHeight = pFrameBuffer->height();
     177            }
     178            /* Re-enable guest-screen with proper resolution: */
     179            LogRelFlow(("UIMultiScreenLayout::update: Enabling guest-screen %d with following resolution: %dx%d.\n",
     180                        iGuestScreen, uWidth, uHeight));
     181            display.SetVideoModeHint(iGuestScreen, true, false, 0, 0, uWidth, uHeight, 32);
    169182        }
    170183    }
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