VirtualBox

Changeset 98943 in vbox for trunk/src


Ignore:
Timestamp:
Mar 13, 2023 4:49:03 PM (2 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
156284
Message:

FE/Qt: bugref:10322: Runtime UI: A bit of sanity for frame-buffer related stuff of machine-view.

File:
1 edited

Legend:

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

    r98841 r98943  
    11891189void UIMachineView::prepareFrameBuffer()
    11901190{
     1191    /* Make sure frame-buffer exists: */
     1192    if (!frameBuffer())
     1193        return;
     1194
    11911195    /* If frame-buffer NOT yet initialized: */
    11921196    if (!frameBuffer()->isInitialized())
     
    13981402QSize UIMachineView::sizeHint() const
    13991403{
    1400     /* Temporarily restrict the size to prevent a brief resize to the
    1401      * frame-buffer dimensions when we exit full-screen.  This is only
    1402      * applied if the frame-buffer is at full-screen dimensions and
    1403      * until the first machine view resize. */
    1404 
    1405     /* Get the frame-buffer dimensions: */
    1406     QSize frameBufferSize(frameBuffer()->width(), frameBuffer()->height());
    1407     /* Take the scale-factor(s) into account: */
    1408     frameBufferSize = scaledForward(frameBufferSize);
    1409     /* Check against the last full-screen size. */
    1410     if (frameBufferSize == uimachine()->lastFullScreenSize(screenId()) && m_sizeHintOverride.isValid())
    1411         return m_sizeHintOverride;
    1412 
    1413     /* Get frame-buffer size-hint: */
    1414     QSize size(frameBuffer()->width(), frameBuffer()->height());
    1415 
    1416     /* Take the scale-factor(s) into account: */
    1417     size = scaledForward(size);
     1404    /* Make sure frame-buffer exists: */
     1405    QSize size;
     1406    if (!frameBuffer())
     1407        size = QSize(640, 480);
     1408    else
     1409    {
     1410        // WORKAROUND:
     1411        // Temporarily restrict the size to prevent a brief resize to the frame-buffer dimensions when
     1412        // we exit full-screen.  This is only applied if the frame-buffer is at full-screen dimensions
     1413        // and until the first machine view resize.
     1414        /* Get the frame-buffer dimensions: */
     1415        QSize frameBufferSize(frameBuffer()->width(), frameBuffer()->height());
     1416        /* Take the scale-factor(s) into account: */
     1417        frameBufferSize = scaledForward(frameBufferSize);
     1418        /* Check against the last full-screen size: */
     1419        if (frameBufferSize == uimachine()->lastFullScreenSize(screenId()) && m_sizeHintOverride.isValid())
     1420            return m_sizeHintOverride;
     1421
     1422        /* Get frame-buffer size-hint: */
     1423        size = QSize(frameBuffer()->width(), frameBuffer()->height());
     1424        /* Take the scale-factor(s) into account: */
     1425        size = scaledForward(size);
    14181426
    14191427#ifdef VBOX_WITH_DEBUGGER_GUI
    1420     /// @todo Fix all DEBUGGER stuff!
    1421     /* HACK ALERT! Really ugly workaround for the resizing to 9x1 done by DevVGA if provoked before power on. */
    1422     if (size.width() < 16 || size.height() < 16)
    1423         if (uiCommon().shouldStartPaused() || uiCommon().isDebuggerAutoShowEnabled())
    1424             size = QSize(640, 480);
    1425 #endif /* !VBOX_WITH_DEBUGGER_GUI */
     1428        /// @todo Fix all DEBUGGER stuff!
     1429        // WORKAROUND:
     1430        // Really ugly workaround for the resizing to 9x1
     1431        // done by DevVGA if provoked before power on.
     1432        if (size.width() < 16 || size.height() < 16)
     1433            if (uiCommon().shouldStartPaused() || uiCommon().isDebuggerAutoShowEnabled())
     1434                size = QSize(640, 480);
     1435#endif /* VBOX_WITH_DEBUGGER_GUI */
     1436    }
    14261437
    14271438    /* Return the resulting size-hint: */
     
    16371648void UIMachineView::updateSliders()
    16381649{
     1650    /* Make sure framebuffer still present: */
     1651    if (!frameBuffer())
     1652        return;
     1653
    16391654    /* Get current viewport size: */
    16401655    QSize curViewportSize = viewport()->size();
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette