VirtualBox

Changeset 44909 in vbox


Ignore:
Timestamp:
Mar 4, 2013 11:25:30 AM (12 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
84079
Message:

FE/Qt: Multi-screen support: Using own setMask implementation again, it will fix few seamless-related issues.

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

Legend:

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

    r44865 r44909  
    200200{
    201201    return session().GetMachine();
     202}
     203
     204void UIMachineWindow::setMask(const QRegion &region)
     205{
     206    /* Call to base-class: */
     207    QMainWindow::setMask(region);
    202208}
    203209
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineWindow.h

    r44865 r44909  
    6161    CSession& session() const;
    6262    CMachine machine() const;
     63
     64    /* Virtual caller for base class setMask: */
     65    virtual void setMask(const QRegion &region);
    6366
    6467protected slots:
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/seamless/UIMachineWindowSeamless.cpp

    r44859 r44909  
    299299void UIMachineWindowSeamless::setMask(const QRegion &constRegion)
    300300{
     301    /* Could be unused under Mac: */
     302    Q_UNUSED(constRegion);
     303
     304#ifndef Q_WS_MAC
     305    /* Copy mask: */
    301306    QRegion region = constRegion;
    302307
     
    305310        region.translate(m_pLeftSpacer->geometry().width(), m_pTopSpacer->geometry().height());
    306311
    307 #if 0 // TODO: Is it really needed now?
    308     /* The global mask shift cause of toolbars and such things. */
    309     region.translate(mMaskShift.width(), mMaskShift.height());
    310 #endif
    311 
    312     /* Mini tool-bar: */
    313 #ifndef Q_WS_MAC
     312    /* Take into account mini tool-bar region: */
    314313    if (m_pMiniToolBar)
    315314    {
    316         /* Get mini-toolbar mask: */
     315        /* Move mini-toolbar region to mini-toolbar position: */
    317316        QRegion toolBarRegion(m_pMiniToolBar->rect());
    318 
    319         /* Move mini-toolbar mask to mini-toolbar position: */
    320317        toolBarRegion.translate(QPoint(m_pMiniToolBar->x(), m_pMiniToolBar->y()));
    321 
    322         /* Including mini-toolbar mask: */
     318        /* Include mini-toolbar region into common one: */
    323319        region += toolBarRegion;
    324320    }
    325321#endif /* !Q_WS_MAC */
    326322
    327 #if 0 // TODO: Is it really needed now?
    328     /* Restrict the drawing to the available space on the screen.
    329      * (The &operator is better than the previous used -operator,
    330      * because this excludes space around the real screen also.
    331      * This is necessary for the mac.) */
    332     region &= mStrictedRegion;
    333 #endif
    334 
    335 #ifdef Q_WS_WIN
     323#if defined (Q_WS_WIN)
     324# if 0 /* This code is disabled for a long time already, need analisys... */
    336325    QRegion difference = m_prevRegion.subtract(region);
    337326
     
    356345
    357346    m_prevRegion = region;
     347# endif /* This code is disabled for a long time already, need analisys... */
     348    UIMachineWindow::setMask(region);
    358349#elif defined (Q_WS_MAC)
    359350# if defined (VBOX_GUI_USE_QUARTZ2D)
    360351    if (vboxGlobal().vmRenderMode() == Quartz2DMode)
    361352    {
    362         /* If we are using the Quartz2D backend we have to trigger
    363          * an repaint only. All the magic clipping stuff is done
    364          * in the paint engine. */
     353        /* If we are using the Quartz2D backend we have to trigger a repaint only.
     354         * All the magic clipping stuff is done in the paint engine. */
    365355        ::darwinWindowInvalidateShape(m_pMachineView->viewport());
    366356    }
    367     else
    368 # endif
    369     {
    370         /* This is necessary to avoid the flicker by an mask update.
    371          * See http://lists.apple.com/archives/Carbon-development/2001/Apr/msg01651.html
    372          * for the hint.
    373          * There *must* be a better solution. */
    374         if (!region.isEmpty())
    375             region |= QRect (0, 0, 1, 1);
    376         // /* Save the current region for later processing in the darwin event handler. */
    377         // mCurrRegion = region;
    378         // /* We repaint the screen before the ReshapeCustomWindow command. Unfortunately
    379         //  * this command flushes a copy of the backbuffer to the screen after the new
    380         //  * mask is set. This leads into a misplaced drawing of the content. Currently
    381         //  * no alternative to this and also this is not 100% perfect. */
    382         // repaint();
    383         // qApp->processEvents();
    384         // /* Now force the reshaping of the window. This is definitely necessary. */
    385         // ReshapeCustomWindow (reinterpret_cast <WindowPtr> (winId()));
    386         UIMachineWindow::setMask(region);
    387         // HIWindowInvalidateShadow (::darwinToWindowRef (mConsole->viewport()));
    388     }
    389 #else
     357# endif /* VBOX_GUI_USE_QUARTZ2D */
     358# if 0 /* This code is disabled for a long time already, need analisys... */
     359    /* This is necessary to avoid the flicker by an mask update.
     360     * See http://lists.apple.com/archives/Carbon-development/2001/Apr/msg01651.html for the hint.
     361     * There *must* be a better solution. */
     362    // if (!region.isEmpty())
     363    //     region |= QRect(0, 0, 1, 1);
     364    // /* Save the current region for later processing in the darwin event handler. */
     365    // mCurrRegion = region;
     366    // /* We repaint the screen before the ReshapeCustomWindow command. Unfortunately
     367    //  * this command flushes a copy of the backbuffer to the screen after the new
     368    //  * mask is set. This leads into a misplaced drawing of the content. Currently
     369    //  * no alternative to this and also this is not 100% perfect. */
     370    // repaint();
     371    // qApp->processEvents();
     372    // /* Now force the reshaping of the window. This is definitely necessary. */
     373    // ReshapeCustomWindow(reinterpret_cast<WindowPtr>(winId()));
     374    // UIMachineWindow::setMask(region);
     375    // HIWindowInvalidateShadow(::darwinToWindowRef(mConsole->viewport()));
     376# endif /* This code is disabled for a long time already, need analisys... */
     377#else /* !Q_WS_MAC */
    390378    UIMachineWindow::setMask(region);
    391379#endif
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