VirtualBox

Changeset 27218 in vbox


Ignore:
Timestamp:
Mar 9, 2010 2:55:14 PM (15 years ago)
Author:
vboxsync
Message:

FE/Qt4: new core: Get the pause image out of the frame buffer if the screen id is greater then 0.

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

Legend:

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

    r27215 r27218  
    772772            CConsole console = session().GetConsole();
    773773
    774             /* Take the screenshot for debugging purposes and save it */
     774            /* Take the screenshot for debugging purposes and save it.
     775             * TODO: create png's from all configured monitors if possible. */
    775776            QString strLogFolder = console.GetMachine().GetLogFolder();
    776777            QString strFileName = strLogFolder + "/VBox.png";
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineView.cpp

    r27215 r27218  
    975975                (state != KMachineState_TeleportingPausedVM || m_previousState != KMachineState_Teleporting))
    976976            {
    977                 /* Take a screen snapshot. Note that TakeScreenShot() always needs a 32bpp image: */
    978                 QImage shot = QImage(m_pFrameBuffer->width(), m_pFrameBuffer->height(), QImage::Format_RGB32);
    979                 CDisplay dsp = session().GetConsole().GetDisplay();
    980                 dsp.TakeScreenShot(shot.bits(), shot.width(), shot.height());
    981                 /* TakeScreenShot() may fail if, e.g. the Paused notification was delivered
    982                  * after the machine execution was resumed. It's not fatal: */
    983                 if (dsp.isOk())
     977                if (screenId() == 0)
    984978                {
    985                     dimImage(shot);
    986                     m_pauseShot = QPixmap::fromImage(shot);
    987                     /* Fully repaint to pick up m_pauseShot: */
    988                     repaint();
     979                    /* Take a screen snapshot. Note that TakeScreenShot() always needs a 32bpp image: */
     980                    QImage shot = QImage(m_pFrameBuffer->width(), m_pFrameBuffer->height(), QImage::Format_RGB32);
     981                    CDisplay dsp = session().GetConsole().GetDisplay();
     982                    dsp.TakeScreenShot(shot.bits(), shot.width(), shot.height());
     983                    /* TakeScreenShot() may fail if, e.g. the Paused notification was delivered
     984                     * after the machine execution was resumed. It's not fatal: */
     985                    if (dsp.isOk())
     986                    {
     987                        dimImage(shot);
     988                        m_pauseShot = QPixmap::fromImage(shot);
     989                        /* Fully repaint to pick up m_pauseShot: */
     990                        repaint();
     991                    }
     992                }else
     993                {
     994                    /* For secondary monitors we support 32 bit formats only for now. */
     995                    if (   m_pFrameBuffer
     996                        && m_pFrameBuffer->pixelFormat() == FramebufferPixelFormat_FOURCC_RGB
     997                        && m_pFrameBuffer->bitsPerPixel() == 32)
     998                    {
     999                        BYTE *pMem;
     1000                        m_pFrameBuffer->GetAddress(&pMem);
     1001                        QImage shot = QImage(pMem, m_pFrameBuffer->width(), m_pFrameBuffer->height(), QImage::Format_RGB32);
     1002                        dimImage(shot);
     1003                        m_pauseShot = QPixmap::fromImage(shot);
     1004                        /* Fully repaint to pick up m_pauseShot: */
     1005                        repaint();
     1006                    }
     1007                    else
     1008                    {
     1009                        /* If there is no framebuffer or a unsupported format, just create a black image to show. */
     1010                        QImage shot = QImage(m_pFrameBuffer->width(), m_pFrameBuffer->height(), QImage::Format_RGB32);
     1011                        shot.fill(0);
     1012                        m_pauseShot = QPixmap::fromImage(shot);
     1013                        /* Fully repaint to pick up m_pauseShot: */
     1014                        repaint();
     1015                    }
    9891016                }
    9901017            }
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UISession.cpp

    r27207 r27218  
    595595    QMenu *pMenu = m_pMenuPool->createMenu(actionsPool());
    596596
    597     /* Re-init menu pool for the case manu were recreated: */
     597    /* Re-init menu pool for the case menu were recreated: */
    598598    reinitMenuPool();
    599599
     
    607607    QMenuBar *pMenuBar = m_pMenuPool->createMenuBar(actionsPool());
    608608
    609     /* Re-init menu pool for the case manu were recreated: */
     609    /* Re-init menu pool for the case menu were recreated: */
    610610    reinitMenuPool();
    611611
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