VirtualBox

Changeset 65234 in vbox


Ignore:
Timestamp:
Jan 11, 2017 7:47:57 AM (8 years ago)
Author:
vboxsync
Message:

FE/Qt: bugref:8722: Runtime UI: Multi-screen layout stuff: Use the cached COM stuff wherever possible. One of those places should fix recursion caused by superfluous COM call on host-screen count change.

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

Legend:

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

    r63054 r65234  
    4848UIMultiScreenLayout::UIMultiScreenLayout(UIMachineLogic *pMachineLogic)
    4949    : m_pMachineLogic(pMachineLogic)
     50    , m_cGuestScreens(m_pMachineLogic->machine().GetMonitorCount())
     51    , m_cHostScreens(0)
    5052{
    5153    /* Calculate host/guest screen count: */
     
    6971     * We have to make sure they are valid, which means there have to be unique combinations
    7072     * and all guests screens need there own host screen. */
    71     CDisplay display = m_pMachineLogic->session().GetConsole().GetDisplay();
    7273    bool fShouldWeAutoMountGuestScreens = gEDataManager->autoMountGuestScreensEnabled(vboxGlobal().managedVMUuid());
    7374    LogRel(("GUI: UIMultiScreenLayout::update: GUI/AutomountGuestScreens is %s\n", fShouldWeAutoMountGuestScreens ? "enabled" : "disabled"));
     
    130131            /* Then we have to disable excessive guest-screen: */
    131132            LogRel(("GUI: UIMultiScreenLayout::update: Disabling excessive guest-screen %d\n", iGuestScreen));
    132             display.SetVideoModeHint(iGuestScreen, false, false, 0, 0, 0, 0, 0);
     133            m_pMachineLogic->display().SetVideoModeHint(iGuestScreen, false, false, 0, 0, 0, 0, 0);
    133134            m_pMachineLogic->uisession()->setScreenVisibleHostDesires(iGuestScreen, false);
    134135        }
     
    164165            LogRel(("GUI: UIMultiScreenLayout::update: Enabling guest-screen %d with following resolution: %dx%d\n",
    165166                    iGuestScreen, uWidth, uHeight));
    166             display.SetVideoModeHint(iGuestScreen, true, false, 0, 0, uWidth, uHeight, 32);
     167            m_pMachineLogic->display().SetVideoModeHint(iGuestScreen, true, false, 0, 0, uWidth, uHeight, 32);
    167168            m_pMachineLogic->uisession()->setScreenVisibleHostDesires(iGuestScreen, true);
    168169        }
     
    227228    /* Check the memory requirements first: */
    228229    bool fSuccess = true;
    229     CMachine machine = m_pMachineLogic->session().GetMachine();
    230230    if (m_pMachineLogic->uisession()->isGuestSupportsGraphics())
    231231    {
    232         quint64 availBits = machine.GetVRAMSize() * _1M * 8;
     232        quint64 availBits = m_pMachineLogic->machine().GetVRAMSize() * _1M * 8;
    233233        quint64 usedBits = memoryRequirements(tmpMap);
    234234        fSuccess = availBits >= usedBits;
     
    263263void UIMultiScreenLayout::calculateGuestScreenCount()
    264264{
    265     /* Get machine: */
    266     CMachine machine = m_pMachineLogic->session().GetMachine();
    267265    /* Enumerate all the guest screens: */
    268266    m_guestScreens.clear();
    269267    m_disabledGuestScreens.clear();
    270     for (uint iGuestScreen = 0; iGuestScreen < machine.GetMonitorCount(); ++iGuestScreen)
     268    for (uint iGuestScreen = 0; iGuestScreen < m_cGuestScreens; ++iGuestScreen)
    271269        if (m_pMachineLogic->uisession()->isScreenVisible(iGuestScreen))
    272270            m_guestScreens << iGuestScreen;
     
    292290    LONG yOrigin = 0;
    293291    quint64 usedBits = 0;
    294     CDisplay display = m_pMachineLogic->uisession()->session().GetConsole().GetDisplay();
    295292    foreach (int iGuestScreen, m_guestScreens)
    296293    {
     
    301298            screen = gpDesktop->screenGeometry(screenLayout.value(iGuestScreen, 0));
    302299        KGuestMonitorStatus monitorStatus = KGuestMonitorStatus_Enabled;
    303         display.GetScreenResolution(iGuestScreen, width, height, guestBpp, xOrigin, yOrigin, monitorStatus);
     300        m_pMachineLogic->display().GetScreenResolution(iGuestScreen, width, height, guestBpp, xOrigin, yOrigin, monitorStatus);
    304301        usedBits += screen.width() * /* display width */
    305302                    screen.height() * /* display height */
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMultiScreenLayout.h

    r62493 r65234  
    7575    QList<int> m_guestScreens;
    7676    QList<int> m_disabledGuestScreens;
     77    const uint m_cGuestScreens;
    7778    int m_cHostScreens;
    7879    QMap<int, int> m_screenMap;
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