VirtualBox

Changeset 98452 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Feb 2, 2023 5:10:37 PM (23 months ago)
Author:
vboxsync
Message:

FE/Qt: bugref:10322: Runtime UI: A bit more cleanup for UISession stuff related to UIFrameBuffer across whole the Runtime UI.

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

Legend:

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

    r98451 r98452  
    403403            visibleWindows.push_back(i);
    404404    return visibleWindows;
     405}
     406
     407QSize UIMachine::guestScreenSize(ulong uScreenId) const
     408{
     409    return uisession()->frameBufferSize(uScreenId);
    405410}
    406411
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachine.h

    r98450 r98452  
    261261        QList<int> listOfVisibleWindows() const;
    262262
     263        /** Returns size for guest-screen with index @a uScreenId. */
     264        QSize guestScreenSize(ulong uScreenId) const;
     265
    263266        /** Returns last full-screen size for guest-screen with index @a uScreenId. */
    264267        QSize lastFullScreenSize(ulong uScreenId) const;
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMultiScreenLayout.cpp

    r98451 r98452  
    3535#include "UIActionPoolRuntime.h"
    3636#include "UIMachineLogic.h"
    37 #include "UIFrameBuffer.h"
    38 #include "UISession.h"
    3937#include "UIMachine.h"
    4038#include "UIMessageCenter.h"
     
    161159            ULONG uHeight = 600;
    162160            /* Try to get previous guest-screen arguments: */
    163             int iGuestScreen = m_disabledGuestScreens[iGuestScreenIndex];
    164             if (UIFrameBuffer *pFrameBuffer = m_pMachineLogic->uisession()->frameBuffer(iGuestScreen))
     161            const int iGuestScreen = m_disabledGuestScreens.at(iGuestScreenIndex);
     162            const QSize guestScreenSize = m_pMachineLogic->uimachine()->guestScreenSize(iGuestScreen);
    165163            {
    166                 if (pFrameBuffer->width() > 0)
    167                     uWidth = pFrameBuffer->width();
    168                 if (pFrameBuffer->height() > 0)
    169                     uHeight = pFrameBuffer->height();
     164                if (guestScreenSize.width() > 0)
     165                    uWidth = guestScreenSize.width();
     166                if (guestScreenSize.height() > 0)
     167                    uHeight = guestScreenSize.height();
    170168            }
    171169            /* Re-enable guest-screen with proper resolution: */
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UISession.cpp

    r98432 r98452  
    299299    if (uScreenId < (ulong)m_frameBufferVector.size())
    300300        m_frameBufferVector[(int)uScreenId] = pFrameBuffer;
     301}
     302
     303QSize UISession::frameBufferSize(ulong uScreenId) const
     304{
     305    UIFrameBuffer *pFramebuffer = frameBuffer(uScreenId);
     306    return pFramebuffer ? QSize(pFramebuffer->width(), pFramebuffer->height()) : QSize();
    301307}
    302308
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UISession.h

    r98427 r98452  
    256256        /** Returns existing frame-buffer vector. */
    257257        const QVector<UIFrameBuffer*> &frameBuffers() const { return m_frameBufferVector; }
     258        /** Returns frame-buffer size for screen with index @a uScreenId. */
     259        QSize frameBufferSize(ulong uScreenId) const;
    258260    /** @} */
    259261
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/fullscreen/UIMachineLogicFullscreen.cpp

    r98451 r98452  
    4040#include "UIMessageCenter.h"
    4141#include "UIMultiScreenLayout.h"
    42 #include "UISession.h"
    4342#include "UIShortcutPool.h"
    4443#ifdef VBOX_WS_MAC
    4544# include "UICocoaApplication.h"
    4645# include "UIExtraDataManager.h"
    47 # include "UIFrameBuffer.h"
    4846# include "VBoxUtils.h"
    4947# include <Carbon/Carbon.h>
     
    777775            const int iWantedHostScreenIndex = hostScreenForGuestScreen((int)uScreenID);
    778776            const int iCurrentHostScreenIndex = UIDesktopWidgetWatchdog::screenNumber(pMachineWindow);
    779             const UIFrameBuffer *pFrameBuffer = uisession()->frameBuffer(uScreenID);
    780             const QSize frameBufferSize(pFrameBuffer->width(), pFrameBuffer->height());
    781             const QSize screenSize = gpDesktop->screenGeometry(iWantedHostScreenIndex).size();
     777            const QSize guestScreenSize = uimachine()->guestScreenSize(uScreenID);
     778            const QSize hostScreenSize = gpDesktop->screenGeometry(iWantedHostScreenIndex).size();
    782779
    783780            /* If that window
     
    801798
    802799            /* If that window
    803              * 1. have another frame-buffer size than actually should. */
    804             else if (frameBufferSize != screenSize)
     800             * 1. have another size than actually should. */
     801            else if (guestScreenSize != hostScreenSize)
    805802            {
    806803                LogRel(("GUI: UIMachineLogicFullscreen::revalidateNativeFullScreen: "
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/fullscreen/UIMachineWindowFullscreen.cpp

    r98386 r98452  
    4343#include "UIMachineWindowFullscreen.h"
    4444#include "UINotificationCenter.h"
    45 #include "UISession.h"
    4645#if   defined(VBOX_WS_WIN) || defined(VBOX_WS_X11)
    4746# include "UIMachineDefs.h"
    4847# include "UIMiniToolBar.h"
    4948#elif defined(VBOX_WS_MAC)
    50 # include "UIFrameBuffer.h"
    5149# include "VBoxUtils-darwin.h"
    5250# include "UICocoaApplication.h"
     
    384382        if (geo.isNull())
    385383        {
    386             const UIFrameBuffer *pFrameBuffer = uisession()->frameBuffer(m_uScreenId);
    387             geo = QRect(QPoint(0, 0), QSize(pFrameBuffer->width(), pFrameBuffer->height()).boundedTo(workingArea.size()));
     384            const QSize guestScreenSize = uimachine()->guestScreenSize(m_uScreenId);
     385            geo = QRect(QPoint(0, 0), guestScreenSize.boundedTo(workingArea.size()));
    388386        }
    389387        /* If normal geometry still null => use default size: */
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