VirtualBox

Changeset 12096 in vbox


Ignore:
Timestamp:
Sep 4, 2008 2:28:36 PM (16 years ago)
Author:
vboxsync
Message:

FE/Qt4-OSX: Make the masking correct if in seamless mode & pause state.

Location:
trunk/src/VBox/Frontends/VirtualBox4
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox4/include/VBoxConsoleView.h

    r11971 r12096  
    8181
    8282    bool pause (bool on);
     83    bool isPaused() { return mLastState == KMachineState_Paused; }
     84    const QPixmap& pauseShot() const { return mPausedShot; }
    8385
    8486    void setMouseIntegrationEnabled (bool enabled);
     
    203205    void setPointerShape (MousePointerChangeEvent *me);
    204206
    205     bool isPaused() { return mLastState == KMachineState_Paused; }
    206207    bool isRunning() { return mLastState == KMachineState_Running; }
    207208
  • trunk/src/VBox/Frontends/VirtualBox4/src/VBoxConsoleView.cpp

    r12018 r12096  
    30233023    }
    30243024
    3025     /* we have a snapshot for the paused state */
    3026     QRect r = pe->rect().intersect (viewport()->rect());
    3027     /* We have to disable paint on screen if we are using the regular painter */
    3028     bool paintOnScreen = viewport()->testAttribute (Qt::WA_PaintOnScreen);
    3029     viewport()->setAttribute (Qt::WA_PaintOnScreen, false);
    3030     QPainter pnt (viewport());
    3031     pnt.drawPixmap (r.x(), r.y(), mPausedShot,
    3032                     r.x() + contentsX(), r.y() + contentsY(),
    3033                     r.width(), r.height());
    3034     /* Restore the attribute to its previous state */
    3035     viewport()->setAttribute (Qt::WA_PaintOnScreen, paintOnScreen);
    3036 
     3025#ifdef VBOX_GUI_USE_QUARTZ2D
     3026    if (mode == VBoxDefs::Quartz2DMode)
     3027        mFrameBuf->paintEvent (pe);
     3028    else
     3029#endif
     3030    {
     3031        /* we have a snapshot for the paused state */
     3032        QRect r = pe->rect().intersect (viewport()->rect());
     3033        /* We have to disable paint on screen if we are using the regular painter */
     3034        bool paintOnScreen = viewport()->testAttribute (Qt::WA_PaintOnScreen);
     3035        viewport()->setAttribute (Qt::WA_PaintOnScreen, false);
     3036        QPainter pnt (viewport());
     3037        pnt.drawPixmap (r.x(), r.y(), mPausedShot,
     3038                        r.x() + contentsX(), r.y() + contentsY(),
     3039                        r.width(), r.height());
     3040        /* Restore the attribute to its previous state */
     3041        viewport()->setAttribute (Qt::WA_PaintOnScreen, paintOnScreen);
    30373042#ifdef Q_WS_MAC
    3038     ::darwinUpdateDockPreview (::darwinToCGImageRef (&mPausedShot),
    3039                                mVirtualBoxLogo,
    3040                                mMainWnd->dockImageState());
    3041 #endif
     3043        ::darwinUpdateDockPreview (::darwinToCGImageRef (&mPausedShot),
     3044                                   mVirtualBoxLogo,
     3045                                   mMainWnd->dockImageState());
     3046#endif
     3047    }
     3048
    30423049}
    30433050
  • trunk/src/VBox/Frontends/VirtualBox4/src/VBoxFBQuartz2D.cpp

    r8915 r12096  
    157157    Assert (mImage);
    158158
    159     QWidget *main = vboxGlobal().mainWindow();
     159    VBoxConsoleWnd *main = qobject_cast <VBoxConsoleWnd *> (vboxGlobal().mainWindow());
    160160    Assert (VALID_PTR (main));
    161161    QWidget* viewport = mView->viewport();
     
    171171    Assert (VALID_PTR (ctx));
    172172    /* We handle the seamless mode as a special case. */
    173     if (qobject_cast <VBoxConsoleWnd *> (main)->isTrueSeamless())
     173    if (main->isTrueSeamless())
    174174    {
    175175        /* Here we paint the windows without any wallpaper.
     
    178178        /* Create a subimage of the current view.
    179179         * Currently this subimage is the whole screen. */
    180         CGImageRef subImage = CGImageCreateWithImageInRect (mImage, CGRectMake (mView->contentsX(), mView->contentsY(), mView->visibleWidth(), mView->visibleHeight()));
     180        CGImageRef subImage;
     181        if (mView->isPaused())
     182            subImage = CGImageCreateWithImageInRect (::darwinToCGImageRef (&mView->pauseShot()), CGRectMake (mView->contentsX(), mView->contentsY(), mView->visibleWidth(), mView->visibleHeight()));
     183        else
     184            subImage = CGImageCreateWithImageInRect (mImage, CGRectMake (mView->contentsX(), mView->contentsY(), mView->visibleWidth(), mView->visibleHeight()));
    181185        Assert (VALID_PTR (subImage));
    182186        /* Clear the background (Make the rect fully transparent) */
     
    221225        QRect ir = aEvent->rect();
    222226        QRect is = QRect (ir.x() + mView->contentsX(), ir.y() + mView->contentsY(), ir.width(), ir.height());
    223         CGImageRef subImage = CGImageCreateWithImageInRect (mImage, ::darwinToHIRect (is));
     227        CGImageRef subImage;
     228        if (mView->isPaused())
     229            subImage = CGImageCreateWithImageInRect (::darwinToCGImageRef (&mView->pauseShot()), ::darwinToHIRect (is));
     230        else
     231            subImage = CGImageCreateWithImageInRect (mImage, ::darwinToHIRect (is));
    224232        Assert (VALID_PTR (subImage));
    225233        /* Ok, for more performance we set a clipping path of the
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