VirtualBox

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


Ignore:
Timestamp:
Oct 6, 2011 9:16:20 PM (13 years ago)
Author:
vboxsync
Message:

FE/Qt: clean up console size hint saving, take 2

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

Legend:

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

    r38962 r38963  
    158158    AssertMsg(newSize.isValid(), ("Size should be valid!\n"));
    159159
    160     /* Remember the new size: */
    161     storeConsoleSize(newSize.width(), newSize.height());
    162 
    163160    /* Send new size-hint to the guest: */
    164161    session().GetConsole().GetDisplay().SetVideoModeHint(newSize.width(), newSize.height(), 0, screenId());
     
    674671void UIMachineView::storeConsoleSize(int iWidth, int iHeight)
    675672{
    676     m_storedConsoleSize = QSize(iWidth, iHeight);
     673    if (m_desktopGeometryType == DesktopGeo_Automatic)
     674        m_storedConsoleSize = QSize(iWidth, iHeight);
    677675}
    678676
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/fullscreen/UIMachineViewFullscreen.cpp

    r38962 r38963  
    126126            setMaximumSize(sizeHint());
    127127
    128             /* Store the new size to prevent unwanted resize hints being sent back: */
    129             storeConsoleSize(pResizeEvent->width(), pResizeEvent->height());
    130 
    131128            /* Perform machine-view resize: */
    132129            resize(pResizeEvent->width(), pResizeEvent->height());
     
    186183                if (pResizeEvent->size() != workingArea().size())
    187184                    break;
     185                /* Store the new size */
     186                storeConsoleSize(pResizeEvent->size().width(), pResizeEvent->size().height());
    188187
    189188                if (m_bIsGuestAutoresizeEnabled && uisession()->isGuestSupportsGraphics())
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/normal/UIMachineViewNormal.cpp

    r38962 r38963  
    116116            setMaximumSize(sizeHint());
    117117
    118             /* Store the new size to prevent unwanted resize hints being sent back: */
    119             storeConsoleSize(pResizeEvent->width(), pResizeEvent->height());
    120 
    121118            /* Perform machine-view resize: */
    122119            resize(pResizeEvent->width(), pResizeEvent->height());
     
    174171            case QEvent::Resize:
    175172            {
     173                const QSize *pSize = &static_cast<QResizeEvent *>(pEvent)
     174                                    ->size();
     175                /* Store the new size */
     176                storeConsoleSize(pSize->width(), pSize->height());
    176177                if (pEvent->spontaneous() && m_bIsGuestAutoresizeEnabled && uisession()->isGuestSupportsGraphics())
    177178                    QTimer::singleShot(300, this, SLOT(sltPerformGuestResize()));
     
    254255void UIMachineViewNormal::saveMachineViewSettings()
    255256{
    256     /* Store guest size hint: */
     257    /* Store guest size in case we are switching to fullscreen: */
    257258    storeGuestSizeHint(QSize(frameBuffer()->width(), frameBuffer()->height()));
    258259}
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/scale/UIMachineViewScale.cpp

    r38962 r38963  
    175175            frameBuffer()->setScaledSize(size());
    176176            frameBuffer()->resizeEvent(pResizeEvent);
    177 
    178             /* Store the new size to prevent unwanted resize hints being sent back: */
    179             storeConsoleSize(pResizeEvent->width(), pResizeEvent->height());
    180177
    181178            /* Let our toplevel widget calculate its sizeHint properly: */
     
    355352void UIMachineViewScale::saveMachineViewSettings()
    356353{
    357     /* Store guest size hint: */
     354    /* Store guest size in case we are switching to fullscreen: */
    358355    storeGuestSizeHint(QSize(frameBuffer()->width(), frameBuffer()->height()));
    359356}
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/seamless/UIMachineViewSeamless.cpp

    r38962 r38963  
    137137            setMaximumSize(sizeHint());
    138138
    139             /* Store the new size to prevent unwanted resize hints being sent back: */
    140             storeConsoleSize(pResizeEvent->width(), pResizeEvent->height());
    141 
    142139            /* Perform machine-view resize: */
    143140            resize(pResizeEvent->width(), pResizeEvent->height());
     
    194191                if (pResizeEvent->size() != workingArea().size())
    195192                    break;
     193                /* Store the new size to prevent unwanted resize hints being sent back: */
     194                storeConsoleSize(pResizeEvent->size().width(), pResizeEvent->size().height());
    196195
    197196                if (uisession()->isGuestSupportsGraphics())
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