VirtualBox

Ignore:
Timestamp:
Feb 2, 2023 2:46:36 PM (2 years ago)
Author:
vboxsync
Message:

FE/Qt: bugref:10322: Runtime UI: Pass guest-additions stuff through UIMachine to detach rest of Runtime UI from UISession.

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

Legend:

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

    r98399 r98450  
    18711871        if (   ulGuestBitsPerPixel != ulBitsPerPixel
    18721872            && ulGuestBitsPerPixel != 0
    1873             && m_pMachineView->uisession()->isGuestSupportsGraphics())
     1873            && m_pMachineView->uimachine()->isGuestSupportsGraphics())
    18741874            UINotificationMessage::remindAboutWrongColorDepth(ulGuestBitsPerPixel, ulBitsPerPixel);
    18751875        else
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachine.cpp

    r98432 r98450  
    235235{
    236236    /* Make sure action-pool knows whether GA supports graphics: */
    237     actionPool()->toRuntime()->setGuestSupportsGraphics(uisession()->isGuestSupportsGraphics());
     237    actionPool()->toRuntime()->setGuestSupportsGraphics(isGuestSupportsGraphics());
    238238    /* Enable/Disable Upgrade Additions action depending on feature status: */
    239239    actionPool()->action(UIActionIndexRT_M_Devices_S_UpgradeGuestAdditions)->setEnabled(uisession()->guestAdditionsUpgradable());
     
    421421    /* Remember last full-screen size: */
    422422    m_monitorLastFullScreenSizeVector[(int)uScreenId] = size;
     423}
     424
     425bool UIMachine::isGuestAdditionsActive() const
     426{
     427    return uisession()->isGuestAdditionsActive();
     428}
     429
     430bool UIMachine::isGuestSupportsGraphics() const
     431{
     432    return uisession()->isGuestSupportsGraphics();
     433}
     434
     435bool UIMachine::isGuestSupportsSeamless() const
     436{
     437    return uisession()->isGuestSupportsSeamless();
    423438}
    424439
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachine.h

    r98432 r98450  
    272272    /** @} */
    273273
     274    /** @name Guest additions stuff.
     275     ** @{ */
     276        /** Returns whether guest additions is active. */
     277        bool isGuestAdditionsActive() const;
     278        /** Returns whether guest additions supports graphics. */
     279        bool isGuestSupportsGraphics() const;
     280        /** Returns whether guest additions supports seamless. */
     281        bool isGuestSupportsSeamless() const;
     282    /** @} */
     283
    274284    /** @name Keyboard stuff.
    275285     ** @{ */
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineLogic.cpp

    r98432 r98450  
    586586    LogRel3(("GUI: UIMachineLogic::sltAdditionsStateChanged: Adjusting actions availability according to GA state.\n"));
    587587    actionPool()->action(UIActionIndexRT_M_View_T_Seamless)->setEnabled(uimachine()->isVisualStateAllowed(UIVisualStateType_Seamless) &&
    588                                                                         uisession()->isGuestSupportsSeamless());
     588                                                                        uimachine()->isGuestSupportsSeamless());
    589589}
    590590
     
    22852285{
    22862286    /* Do not process if additions are not loaded! */
    2287     if (!uisession()->isGuestAdditionsActive())
     2287    if (!uimachine()->isGuestAdditionsActive())
    22882288        UINotificationMessage::remindAboutGuestAdditionsAreNotActive();
    22892289
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineView.cpp

    r98432 r98450  
    681681     * ourselves.  Windows guests should use VBoxVGA controllers, not VMSVGA. */
    682682    if (   !isFullscreenOrSeamless()
    683         && uisession()->isGuestSupportsGraphics()
     683        && uimachine()->isGuestSupportsGraphics()
    684684        && (machine().GetGraphicsAdapter().GetGraphicsControllerType() != KGraphicsControllerType_VMSVGA))
    685685        setStoredGuestScreenSizeHint(frameBufferSizeNew);
     
    779779     * Do not send a hint if nothing has changed to prevent the guest being notified about its own changes. */
    780780    if (   !isFullscreenOrSeamless()
    781         && uisession()->isGuestSupportsGraphics()
     781        && uimachine()->isGuestSupportsGraphics()
    782782        && (   (int)frameBuffer()->width() != size.width()
    783783            || (int)frameBuffer()->height() != size.height()
     
    854854        }
    855855        /* Do not send a hint if GA supports graphics and we have sent that hint already: */
    856         if (fSendHint && uisession()->isGuestSupportsGraphics() && m_lastSizeHint == size)
     856        if (fSendHint && uimachine()->isGuestSupportsGraphics() && m_lastSizeHint == size)
    857857        {
    858858            LogRel(("GUI: UIMachineView::sltPerformGuestResize: Omitting to send size-hint %dx%d to guest-screen %d "
     
    914914         * Do not send a hint if nothing has changed to prevent the guest being notified about its own changes. */
    915915        if (   !isFullscreenOrSeamless()
    916             && uisession()->isGuestSupportsGraphics()
     916            && uimachine()->isGuestSupportsGraphics()
    917917            && (   frameBuffer()->width() != uWidth
    918918                || frameBuffer()->height() != uHeight
     
    965965     * Do not send a hint if nothing has changed to prevent the guest being notified about its own changes. */
    966966    if (   !isFullscreenOrSeamless()
    967         && uisession()->isGuestSupportsGraphics()
     967        && uimachine()->isGuestSupportsGraphics()
    968968        && (   (int)frameBuffer()->width() != size.width()
    969969            || (int)frameBuffer()->height() != size.height()
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMultiScreenLayout.cpp

    r98386 r98450  
    236236    /* Check the memory requirements first: */
    237237    bool fSuccess = true;
    238     if (m_pMachineLogic->uisession()->isGuestSupportsGraphics())
     238    if (m_pMachineLogic->uimachine()->isGuestSupportsGraphics())
    239239    {
    240240        quint64 availBits = m_pMachineLogic->machine().GetGraphicsAdapter().GetVRAMSize() * _1M * 8;
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/fullscreen/UIMachineLogicFullscreen.cpp

    r98432 r98450  
    8484{
    8585    /* Check if there is enough physical memory to enter fullscreen: */
    86     if (uisession()->isGuestSupportsGraphics())
     86    if (uimachine()->isGuestSupportsGraphics())
    8787    {
    8888        quint64 availBits = machine().GetGraphicsAdapter().GetVRAMSize() /* VRAM */ * _1M /* MiB to bytes */ * 8 /* to bits */;
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/fullscreen/UIMachineViewFullscreen.cpp

    r98386 r98450  
    128128        m_fGuestAutoresizeEnabled = fEnabled;
    129129
    130         if (m_fGuestAutoresizeEnabled && uisession()->isGuestSupportsGraphics())
     130        if (m_fGuestAutoresizeEnabled && uimachine()->isGuestSupportsGraphics())
    131131            sltPerformGuestResize();
    132132    }
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/normal/UIMachineLogicNormal.cpp

    r98432 r98450  
    9090        {
    9191            /* And supported: */
    92             if (uisession()->isGuestSupportsSeamless())
     92            if (uimachine()->isGuestSupportsSeamless())
    9393            {
    9494                LogRel(("GUI: UIMachineLogicNormal::sltCheckForRequestedVisualStateType: "
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/normal/UIMachineViewNormal.cpp

    r98419 r98450  
    7070                setMaximumGuestSize();
    7171                /* And resize guest to current window size: */
    72                 if (m_fGuestAutoresizeEnabled && uisession()->isGuestSupportsGraphics())
     72                if (m_fGuestAutoresizeEnabled && uimachine()->isGuestSupportsGraphics())
    7373                    QTimer::singleShot(300, this, SLOT(sltPerformGuestResize()));
    7474                break;
     
    142142        m_fGuestAutoresizeEnabled = fEnabled;
    143143
    144         if (m_fGuestAutoresizeEnabled && uisession()->isGuestSupportsGraphics())
     144        if (m_fGuestAutoresizeEnabled && uimachine()->isGuestSupportsGraphics())
    145145            sltPerformGuestResize();
    146146    }
     
    205205     * or the guest-additions doesn't support graphics
    206206     * we should take scroll-bars size-hints into account: */
    207     if (!m_fGuestAutoresizeEnabled || !uisession()->isGuestSupportsGraphics())
     207    if (!m_fGuestAutoresizeEnabled || !uimachine()->isGuestSupportsGraphics())
    208208    {
    209209        if (verticalScrollBar()->isVisible())
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/normal/UIMachineWindowNormal.cpp

    r98432 r98450  
    670670         * we should deduce widget's size-hint on visible scroll-bar's hint: */
    671671        if (   !machineView()->isGuestAutoresizeEnabled()
    672             || !uisession()->isGuestSupportsGraphics())
     672            || !uimachine()->isGuestSupportsGraphics())
    673673        {
    674674            if (machineView()->verticalScrollBar()->isVisible())
     
    694694    if (   frGeoNew != frGeo
    695695        && (   !machineView()->isGuestAutoresizeEnabled()
    696             || !uisession()->isGuestSupportsGraphics()))
     696            || !uimachine()->isGuestSupportsGraphics()))
    697697    {
    698698        /* Determine whether we need additional space for one or both scroll-bars: */
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/seamless/UIMachineLogicSeamless.cpp

    r98432 r98450  
    8080{
    8181    /* Check if there is enough physical memory to enter seamless: */
    82     if (uisession()->isGuestSupportsSeamless())
     82    if (uimachine()->isGuestSupportsSeamless())
    8383    {
    8484        quint64 availBits = machine().GetGraphicsAdapter().GetVRAMSize() /* VRAM */ * _1M /* MiB to bytes */ * 8 /* to bits */;
     
    129129
    130130    /* If 'seamless' visual-state type is no more supported: */
    131     if (!uisession()->isGuestSupportsSeamless())
     131    if (!uimachine()->isGuestSupportsSeamless())
    132132    {
    133133        LogRel(("GUI: UIMachineLogicSeamless::sltCheckForRequestedVisualStateType: "
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