VirtualBox

Changeset 4098 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Aug 9, 2007 3:41:38 PM (18 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
23553
Message:

2079: Create seamless mode for Windows guests:

WinAPI QWidget::setMask() reimplementation to avoid flicker in Seamless Mode under Win32. Some type of rasterizer used to update only the changed region.

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

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/include/VBoxConsoleWnd.h

    r4071 r4098  
    7676
    7777    void installGuestAdditionsFrom (const QString &aSource);
     78
     79#ifdef Q_WS_WIN32
     80    void setMask (const QRegion &aRegion);
     81#endif
    7882
    7983public slots:
     
    284288    QSize prev_min_size;
    285289
     290#ifdef Q_WS_WIN32
     291    QRegion mPrevRegion;
     292#endif
     293
    286294    // variables for dealing with true fullscreen
    287295    bool mIsFullscreen : 1;
  • trunk/src/VBox/Frontends/VirtualBox/src/VBoxConsoleWnd.cpp

    r4092 r4098  
    18851885            QApplication::desktop()->screenGeometry (this);
    18861886
     1887#ifdef Q_WS_WIN32
     1888        mPrevRegion = scrGeo;
     1889#endif
     1890
    18871891        /* hide early to avoid extra flicker */
    18881892        hide();
     
    23892393        updateAppearanceOf (DVDStuff);
    23902394}
     2395
     2396#ifdef Q_WS_WIN32
     2397void VBoxConsoleWnd::setMask (const QRegion &aRegion)
     2398{
     2399    QRegion diff = mPrevRegion.subtract (aRegion);
     2400
     2401    /* Region offset calculation */
     2402    int fleft = 0, ftop = 0;
     2403    if (isTopLevel())
     2404    {
     2405        ftop = topData()->ftop;
     2406        fleft = topData()->fleft;
     2407    }
     2408
     2409    /* Visible region calculation */
     2410    HRGN newReg = CreateRectRgn (0, 0, 0, 0);
     2411    CombineRgn (newReg, aRegion.handle(), 0, RGN_COPY);
     2412    OffsetRgn (newReg, fleft, ftop);
     2413
     2414    /* Invisible region calculation */
     2415    HRGN oldReg = CreateRectRgn (0, 0, 0, 0);
     2416    CombineRgn (oldReg, diff.handle(), 0, RGN_COPY);
     2417    OffsetRgn (oldReg, fleft, ftop);
     2418
     2419    /* Set the current visible region and clean the previous */
     2420    SetWindowRgn (winId(), newReg, FALSE);
     2421    ValidateRgn (winId(), newReg);
     2422    RedrawWindow (NULL, NULL, oldReg, RDW_INVALIDATE | RDW_UPDATENOW | RDW_ALLCHILDREN);
     2423
     2424    mPrevRegion = aRegion;
     2425}
     2426#endif
    23912427
    23922428/**
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette