VirtualBox

Changeset 32407 in vbox


Ignore:
Timestamp:
Sep 10, 2010 1:39:19 PM (14 years ago)
Author:
vboxsync
Message:

FE/Qt4: show full VM output on save state restore

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

Legend:

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

    r31341 r32407  
    162162            break;
    163163        }
    164 #ifdef VBOX_TEST_IMAGE_ON_RESTORE
    165164        case KMachineState_Restoring:
    166165        {
     
    174173            break;
    175174        }
    176 #endif
    177175        case KMachineState_Running:
    178176        {
     
    384382    }
    385383
    386 #ifdef VBOX_TEST_IMAGE_ON_RESTORE
    387384    QSize size;
    388385#ifdef Q_WS_X11
     
    399396    machine.QuerySavedScreenshotPNGSize(0, buffer, width, height);
    400397    if (buffer > 0)
    401         size = guestSizeHint();
     398    {
     399        /* Init with the screenshot size */
     400        size = QSize(width, height);
     401        /* Try to get the real guest dimensions from the save state */
     402        ULONG guestWidth = 0, guestHeight = 0;
     403        machine.QuerySavedGuestSize(0, guestWidth, guestHeight);
     404        if (   guestWidth  > 0
     405            && guestHeight > 0)
     406            size = QSize(guestWidth, guestHeight);
     407    }
    402408    /* If we have a valid size, resize the framebuffer. */
    403409    if (   size.width() > 0
     
    407413        frameBuffer()->resizeEvent(&event);
    408414    }
    409 #else
    410 #ifdef Q_WS_X11
    411     /* Processing pseudo resize-event to synchronize frame-buffer
    412      * with stored framebuffer size in case of machine state was 'saved': */
    413     if (session().GetMachine().GetState() == KMachineState_Saved)
    414     {
    415         QSize size = guestSizeHint();
    416         UIResizeEvent event(FramebufferPixelFormat_Opaque, NULL, 0, 0, size.width(), size.height());
    417         frameBuffer()->resizeEvent(&event);
    418     }
    419 #endif /* Q_WS_X11 */
    420 #endif
    421415}
    422416
     
    684678    if (screenData.size() != 0)
    685679    {
    686         QImage shot = QImage::fromData(screenData.data(), screenData.size(), "PNG").scaled(guestSizeHint());
     680        ULONG guestWidth = 0, guestHeight = 0;
     681        machine.QuerySavedGuestSize(0, guestWidth, guestHeight);
     682        QImage shot = QImage::fromData(screenData.data(), screenData.size(), "PNG").scaled(guestWidth > 0 ? QSize(guestWidth, guestHeight) : guestSizeHint());
    687683        dimImage(shot);
    688684        m_pauseShot = QPixmap::fromImage(shot);
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/scale/UIMachineViewScale.cpp

    r32174 r32407  
    102102    if (screenData.size() != 0)
    103103    {
    104         QImage shot = QImage::fromData(screenData.data(), screenData.size(), "PNG").scaled(guestSizeHint());
     104        ULONG guestWidth = 0, guestHeight = 0;
     105        machine.QuerySavedGuestSize(0, guestWidth, guestHeight);
     106        QImage shot = QImage::fromData(screenData.data(), screenData.size(), "PNG").scaled(guestWidth > 0 ? QSize(guestWidth, guestHeight) : guestSizeHint());
    105107        m_pPauseImage = new QImage(shot);
    106108        scalePauseShot();
     
    127129        if (scaledSize.isValid())
    128130        {
    129             QImage tmpImg = m_pPauseImage->scaled(frameBuffer()->scaledSize(), Qt::IgnoreAspectRatio, Qt::SmoothTransformation);
     131            QImage tmpImg = m_pPauseImage->scaled(scaledSize, Qt::IgnoreAspectRatio, Qt::SmoothTransformation);
    130132            dimImage(tmpImg);
    131133            m_pauseShot = QPixmap::fromImage(tmpImg);
     
    238240                               qobject_cast<QMainWindow*>(machineWindowWrapper()->machineWindow()) : 0;
    239241
    240     if (pWatched != 0 && pWatched == pMainDialog)
     242    if (pWatched != 0 && pWatched == viewport())
    241243    {
    242244        switch (pEvent->type())
     
    248250                break;
    249251            }
     252            default:
     253                break;
     254        }
     255    }
     256    else if (pWatched != 0 && pWatched == pMainDialog)
     257    {
     258        switch (pEvent->type())
     259        {
    250260#if defined (Q_WS_WIN32)
    251261# if defined (VBOX_GUI_USE_DDRAW)
     
    307317    }
    308318
    309 #ifdef VBOX_TEST_IMAGE_ON_RESTORE
    310319    QSize size;
    311320#ifdef Q_WS_X11
     
    322331    machine.QuerySavedScreenshotPNGSize(0, buffer, width, height);
    323332    if (buffer > 0)
    324         size = guestSizeHint();
     333    {
     334        /* Init with the screenshot size */
     335        size = QSize(width, height);
     336        /* Try to get the real guest dimensions from the save state */
     337        ULONG guestWidth = 0, guestHeight = 0;
     338        machine.QuerySavedGuestSize(0, guestWidth, guestHeight);
     339        if (   guestWidth  > 0
     340            && guestHeight > 0)
     341            size = QSize(guestWidth, guestHeight);
     342    }
    325343    /* If we have a valid size, resize the framebuffer. */
    326344    if (   size.width() > 0
     
    329347        UIResizeEvent event(FramebufferPixelFormat_Opaque, NULL, 0, 0, size.width(), size.height());
    330348        frameBuffer()->resizeEvent(&event);
    331         QTimer::singleShot(0, this, SLOT(sltPerformGuestScale()));
    332     }
    333 #endif
     349    }
    334350}
    335351
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