VirtualBox

Changeset 59079 in vbox for trunk/src/VBox/Frontends


Ignore:
Timestamp:
Dec 10, 2015 4:07:16 PM (9 years ago)
Author:
vboxsync
Message:

FE/Qt: bugref:8149: Runtime UI: Machine View: UI Session: Machine Logic: Multi Screen Layout: Caching screen visibility for host-desires and using them to make an opinion to update guest-screen status when GA state-change event arrives. It is only done when auto-mount of guest-screens enabled.

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

Legend:

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

    r58943 r59079  
    307307            "Sending guest size-hint to screen %d as %dx%d\n",
    308308            (int)screenId(), size.width(), size.height()));
    309     display().SetVideoModeHint(screenId(),
    310                                uisession()->isScreenVisible(screenId()),
    311                                false, 0, 0, size.width(), size.height(), 0);
     309
     310    /* If auto-mount of guest-screens (auto-pilot) enabled: */
     311    if (gEDataManager->autoMountGuestScreensEnabled(vboxGlobal().managedVMUuid()))
     312    {
     313        /* If host and guest have same opinion about guest-screen visibility: */
     314        if (uisession()->isScreenVisible(screenId()) == uisession()->isScreenVisibleHostDesires(screenId()))
     315            display().SetVideoModeHint(screenId(),
     316                                       uisession()->isScreenVisible(screenId()),
     317                                       false, 0, 0, size.width(), size.height(), 0);
     318        /* If host desires to have guest-screen disabled and guest-screen is enabled, retrying: */
     319        else if (!uisession()->isScreenVisibleHostDesires(screenId()))
     320            display().SetVideoModeHint(screenId(), false, false, 0, 0, 0, 0, 0);
     321        /* If host desires to have guest-screen enabled and guest-screen is disabled, retrying: */
     322        else if (uisession()->isScreenVisibleHostDesires(screenId()))
     323            display().SetVideoModeHint(screenId(), true, false, 0, 0, size.width(), size.height(), 0);
     324    }
     325    /* If auto-mount of guest-screens (auto-pilot) disabled: */
     326    else
     327    {
     328        display().SetVideoModeHint(screenId(),
     329                                   uisession()->isScreenVisible(screenId()),
     330                                   false, 0, 0, size.width(), size.height(), 0);
     331    }
    312332}
    313333
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMultiScreenLayout.cpp

    r57591 r59079  
    130130            LogRel(("GUI: UIMultiScreenLayout::update: Disabling excessive guest-screen %d\n", iGuestScreen));
    131131            display.SetVideoModeHint(iGuestScreen, false, false, 0, 0, 0, 0, 0);
     132            m_pMachineLogic->uisession()->setScreenVisibleHostDesires(iGuestScreen, false);
    132133        }
    133134    }
     
    163164                    iGuestScreen, uWidth, uHeight));
    164165            display.SetVideoModeHint(iGuestScreen, true, false, 0, 0, uWidth, uHeight, 32);
     166            m_pMachineLogic->uisession()->setScreenVisibleHostDesires(iGuestScreen, true);
    165167        }
    166168    }
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UISession.cpp

    r58881 r59079  
    12121212            m_monitorVisibilityVector[0] = true;
    12131213    }
     1214
     1215    /* Prepare initial screen visibility status of host-desires.
     1216     * This is mostly dummy initialization as host-desires should get updated later in multi-screen layout.
     1217     * By default making host-desires same as facts. */
     1218    m_monitorVisibilityVectorHostDesires.resize(machine().GetMonitorCount());
     1219    for (int iScreenIndex = 0; iScreenIndex < m_monitorVisibilityVector.size(); ++iScreenIndex)
     1220        m_monitorVisibilityVectorHostDesires[iScreenIndex] = m_monitorVisibilityVector[iScreenIndex];
    12141221}
    12151222
     
    18671874}
    18681875
     1876bool UISession::isScreenVisibleHostDesires(ulong uScreenId) const
     1877{
     1878    /* Make sure index feats the bounds: */
     1879    AssertReturn(uScreenId < (ulong)m_monitorVisibilityVectorHostDesires.size(), false);
     1880
     1881    /* Return 'actual' (host-desire) visibility status: */
     1882    return m_monitorVisibilityVectorHostDesires.value((int)uScreenId);
     1883}
     1884
     1885void UISession::setScreenVisibleHostDesires(ulong uScreenId, bool fIsMonitorVisible)
     1886{
     1887    /* Make sure index feats the bounds: */
     1888    AssertReturnVoid(uScreenId < (ulong)m_monitorVisibilityVectorHostDesires.size());
     1889
     1890    /* Remember 'actual' (host-desire) visibility status: */
     1891    m_monitorVisibilityVectorHostDesires[(int)uScreenId] = fIsMonitorVisible;
     1892}
     1893
    18691894bool UISession::isScreenVisible(ulong uScreenId) const
    18701895{
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UISession.h

    r58896 r59079  
    222222    void setMouseCaptured(bool fIsMouseCaptured) { m_fIsMouseCaptured = fIsMouseCaptured; }
    223223    void setMouseIntegrated(bool fIsMouseIntegrated) { m_fIsMouseIntegrated = fIsMouseIntegrated; }
     224
     225    /* Screen visibility status for host-desires: */
     226    bool isScreenVisibleHostDesires(ulong uScreenId) const;
     227    void setScreenVisibleHostDesires(ulong uScreenId, bool fIsMonitorVisible);
    224228
    225229    /* Screen visibility status: */
     
    423427    QVector<bool> m_monitorVisibilityVector;
    424428
     429    /* Screen visibility vector for host-desires: */
     430    QVector<bool> m_monitorVisibilityVectorHostDesires;
     431
    425432    /* Screen last full-screen size vector: */
    426433    QVector<QSize> m_monitorLastFullScreenSizeVector;
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/fullscreen/UIMachineLogicFullscreen.cpp

    r58815 r59079  
    454454{
    455455    LogRel2(("GUI: UIMachineLogicFullscreen: Host-screen available-area change ignored\n"));
     456}
     457
     458void UIMachineLogicFullscreen::sltAdditionsStateChanged()
     459{
     460    /* Call to base-class: */
     461    UIMachineLogic::sltAdditionsStateChanged();
     462
     463    LogRel(("GUI: UIMachineLogicFullscreen: Additions-state actual-change event, rebuild multi-screen layout\n"));
     464    /* Rebuild multi-screen layout: */
     465    m_pScreenLayout->rebuild();
    456466}
    457467
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/fullscreen/UIMachineLogicFullscreen.h

    r55401 r59079  
    110110    /** Handles host-screen available-area change. */
    111111    virtual void sltHostScreenAvailableAreaChange();
     112    /** Handles additions-state change. */
     113    virtual void sltAdditionsStateChanged();
    112114
    113115private:
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/normal/UIMachineLogicNormal.cpp

    r55697 r59079  
    228228    display().GetScreenResolution(iIndex, uWidth, uHeight, uBitsPerPixel, uOriginX, uOriginY, monitorStatus);
    229229    if (!fEnabled)
     230    {
    230231        display().SetVideoModeHint(iIndex, false, false, 0, 0, 0, 0, 0);
     232        uisession()->setScreenVisibleHostDesires(iIndex, false);
     233    }
    231234    else
    232235    {
     
    237240            uHeight = 600;
    238241        display().SetVideoModeHint(iIndex, true, false, 0, 0, uWidth, uHeight, 32);
     242        uisession()->setScreenVisibleHostDesires(iIndex, true);
    239243    }
    240244}
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/normal/UIMachineViewNormal.cpp

    r57591 r59079  
    156156                               guestScreenVisibilityStatus(),
    157157                               false, 0, 0, sizeHint.width(), sizeHint.height(), 0);
     158    uisession()->setScreenVisibleHostDesires(screenId(), guestScreenVisibilityStatus());
    158159}
    159160
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/scale/UIMachineViewScale.cpp

    r58011 r59079  
    164164                               guestScreenVisibilityStatus(),
    165165                               false, 0, 0, sizeHint.width(), sizeHint.height(), 0);
     166    uisession()->setScreenVisibleHostDesires(screenId(), guestScreenVisibilityStatus());
    166167}
    167168
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/seamless/UIMachineLogicSeamless.cpp

    r57591 r59079  
    207207}
    208208
     209void UIMachineLogicSeamless::sltAdditionsStateChanged()
     210{
     211    /* Call to base-class: */
     212    UIMachineLogic::sltAdditionsStateChanged();
     213
     214    LogRel(("GUI: UIMachineLogicSeamless: Additions-state actual-change event, rebuild multi-screen layout\n"));
     215    /* Rebuild multi-screen layout: */
     216    m_pScreenLayout->rebuild();
     217}
     218
    209219void UIMachineLogicSeamless::prepareActionGroups()
    210220{
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/seamless/UIMachineLogicSeamless.h

    r55401 r59079  
    6767    /** Handles host-screen count change. */
    6868    virtual void sltHostScreenCountChange();
     69    /** Handles additions-state change. */
     70    virtual void sltAdditionsStateChanged();
    6971
    7072#ifndef RT_OS_DARWIN
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