VirtualBox

Changeset 28246 in vbox


Ignore:
Timestamp:
Apr 13, 2010 12:38:08 PM (15 years ago)
Author:
vboxsync
Message:

FE/QT: remove TakeScreenShot workaround for multimonitor.

File:
1 edited

Legend:

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

    r28241 r28246  
    12221222                (state != KMachineState_TeleportingPausedVM || m_previousState != KMachineState_Teleporting))
    12231223            {
    1224                 if (screenId() == 0)
     1224                /* Take a screen snapshot. Note that TakeScreenShot() always needs a 32bpp image: */
     1225                QImage shot = QImage(m_pFrameBuffer->width(), m_pFrameBuffer->height(), QImage::Format_RGB32);
     1226                /* If TakeScreenShot fails or returns no image, just show a black image. */
     1227                shot.fill(0);
     1228                CDisplay dsp = session().GetConsole().GetDisplay();
     1229                dsp.TakeScreenShot(screenId(), shot.bits(), shot.width(), shot.height());
     1230                /* TakeScreenShot() may fail if, e.g. the Paused notification was delivered
     1231                 * after the machine execution was resumed. It's not fatal: */
     1232                if (dsp.isOk())
    12251233                {
    1226                     /* Take a screen snapshot. Note that TakeScreenShot() always needs a 32bpp image: */
    1227                     QImage shot = QImage(m_pFrameBuffer->width(), m_pFrameBuffer->height(), QImage::Format_RGB32);
    1228                     CDisplay dsp = session().GetConsole().GetDisplay();
    1229                     dsp.TakeScreenShot(screenId(), shot.bits(), shot.width(), shot.height());
    1230                     /* TakeScreenShot() may fail if, e.g. the Paused notification was delivered
    1231                      * after the machine execution was resumed. It's not fatal: */
    1232                     if (dsp.isOk())
    1233                     {
    1234                         dimImage(shot);
    1235                         m_pauseShot = QPixmap::fromImage(shot);
    1236                         /* Fully repaint to pick up m_pauseShot: */
    1237                         viewport()->repaint();
    1238                     }
    1239                 }else
    1240                 {
    1241                     /* For secondary monitors we support 32 bit formats only for now. */
    1242                     if (   m_pFrameBuffer
    1243                         && m_pFrameBuffer->address()
    1244                         && m_pFrameBuffer->pixelFormat() == FramebufferPixelFormat_FOURCC_RGB
    1245                         && m_pFrameBuffer->bitsPerPixel() == 32)
    1246                     {
    1247                         /* Make a *real* depth copy out of the current framebuffer content. */
    1248                         QImage shot = QImage(m_pFrameBuffer->address(), m_pFrameBuffer->width(), m_pFrameBuffer->height(), QImage::Format_RGB32).copy();
    1249                         dimImage(shot);
    1250                         m_pauseShot = QPixmap::fromImage(shot);
    1251                         /* Fully repaint to pick up m_pauseShot: */
    1252                         viewport()->repaint();
    1253                     }
    1254                     else
    1255                     {
    1256                         /* If there is no framebuffer or a unsupported format, just create a black image to show. */
    1257                         QImage shot = QImage(m_pFrameBuffer->width(), m_pFrameBuffer->height(), QImage::Format_RGB32);
    1258                         shot.fill(0);
    1259                         m_pauseShot = QPixmap::fromImage(shot);
    1260                         /* Fully repaint to pick up m_pauseShot: */
    1261                         viewport()->repaint();
    1262                     }
     1234                    dimImage(shot);
    12631235                }
     1236                m_pauseShot = QPixmap::fromImage(shot);
     1237                /* Fully repaint to pick up m_pauseShot: */
     1238                viewport()->repaint();
    12641239            }
    12651240            break;
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