VirtualBox

Changeset 53365 in vbox for trunk


Ignore:
Timestamp:
Nov 20, 2014 5:59:13 PM (10 years ago)
Author:
vboxsync
Message:

FE/Qt: 6278: Preparing to support for scaled video-output: Size-hint stuff.

File:
1 edited

Legend:

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

    r53364 r53365  
    218218                                   frameBuffer()->height() != iHeight;
    219219
    220         // TODO: Move to appropriate place!
    221         /* Adjust 'scale' mode for current machine-view size: */
     220        /* Adjust 'scale' mode to current machine-view size: */
    222221        if (visualStateType() == UIVisualStateType_Scale)
     222        {
     223            /* Assign new frame-buffer logical-size: */
    223224            frameBuffer()->setScaledSize(size());
     225        }
    224226
    225227        /* Perform frame-buffer mode-change: */
     
    603605    if (m_sizeHintOverride.isValid())
    604606        return m_sizeHintOverride;
     607
     608    /* Get frame-buffer size-hint: */
     609    QSize size(m_pFrameBuffer->width(), m_pFrameBuffer->height());
     610
    605611#ifdef VBOX_WITH_DEBUGGER_GUI
    606612    // TODO: Fix all DEBUGGER stuff!
    607613    /* HACK ALERT! Really ugly workaround for the resizing to 9x1 done by DevVGA if provoked before power on. */
    608     QSize fb(m_pFrameBuffer->width(), m_pFrameBuffer->height());
    609     if (fb.width() < 16 || fb.height() < 16)
     614    if (size.width() < 16 || size.height() < 16)
    610615        if (vboxGlobal().isStartPausedEnabled() || vboxGlobal().isDebuggerAutoShowEnabled())
    611             fb = QSize(640, 480);
    612     return QSize(fb.width() + frameWidth() * 2, fb.height() + frameWidth() * 2);
    613 #else /* !VBOX_WITH_DEBUGGER_GUI */
    614     return QSize(m_pFrameBuffer->width() + frameWidth() * 2, m_pFrameBuffer->height() + frameWidth() * 2);
     616            size = QSize(640, 480);
    615617#endif /* !VBOX_WITH_DEBUGGER_GUI */
     618
     619    /* Return the resulting size-hint: */
     620    return QSize(size.width() + frameWidth() * 2, size.height() + frameWidth() * 2);
    616621}
    617622
     
    680685    QSize size = gEDataManager->lastGuestSizeHint(m_uScreenId, vboxGlobal().managedVMUuid());
    681686
    682     /* Return loaded or default: */
    683     return size.isValid() ? size : QSize(800, 600);
     687    /* Invent the default if necessary: */
     688    if (!size.isValid())
     689        size = QSize(800, 600);
     690
     691    /* Return size: */
     692    return size;
    684693}
    685694
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