VirtualBox

Changeset 48705 in vbox for trunk


Ignore:
Timestamp:
Sep 26, 2013 12:20:47 PM (11 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
89333
Message:

FE/Qt: Runtime UI: Moving *translucent seamless* feature under #ifdef (enabled only on MacOS X host currently).

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

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/Makefile.kmk

    r48548 r48705  
    8080VirtualBox_DEFS           =
    8181VirtualBox_DEFS.debug     = VBOX_CHECK_STATE # QT_FATAL_ASSERT
    82 VirtualBox_DEFS.darwin    = VBOX_GUI_USE_QIMAGE VBOX_GUI_USE_QUARTZ2D
     82VirtualBox_DEFS.darwin    = VBOX_GUI_USE_QIMAGE VBOX_GUI_USE_QUARTZ2D VBOX_WITH_TRANSLUCENT_SEAMLESS
    8383VirtualBox_DEFS.freebsd   = VBOX_GUI_USE_QIMAGE
    8484VirtualBox_DEFS.linux     = VBOX_GUI_USE_QIMAGE
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIFrameBuffer.cpp

    r47493 r48705  
    2727# include "UIMessageCenter.h"
    2828# include "VBoxGlobal.h"
    29 # ifdef Q_WS_X11
     29# ifndef VBOX_WITH_TRANSLUCENT_SEAMLESS
    3030#  include "UIMachineWindow.h"
    31 # endif /* Q_WS_X11 */
     31# endif /* !VBOX_WITH_TRANSLUCENT_SEAMLESS */
    3232
    3333/* Other VBox includes: */
     
    375375    m_asyncVisibleRegion = region;
    376376
    377 #ifdef Q_WS_X11
    378     /* Qt 4.8.3 under X11 has Qt::WA_TranslucentBackground window attribute broken,
    379      * so we are also have to use async visible-region to apply to [Q]Widget [set]Mask
    380      * which internally wraps old one known (approved) Xshape extension: */
     377#ifndef VBOX_WITH_TRANSLUCENT_SEAMLESS
     378    /* We have to use async visible-region to apply to [Q]Widget [set]Mask: */
    381379    m_pMachineView->machineWindow()->setMask(m_asyncVisibleRegion);
    382 #endif /* Q_WS_X11 */
     380#endif /* !VBOX_WITH_TRANSLUCENT_SEAMLESS */
    383381}
    384382
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIFrameBufferQImage.cpp

    r47510 r48705  
    250250        foreach (const QRect &rect, regionToPaint.rects())
    251251        {
    252 #ifdef Q_WS_WIN
     252#if defined(VBOX_WITH_TRANSLUCENT_SEAMLESS) && defined(Q_WS_WIN)
    253253            /* Replace translucent background with black one,
    254254             * that is necessary for window with Qt::WA_TranslucentBackground: */
     
    256256            painter.fillRect(rect, QColor(Qt::black));
    257257            painter.setCompositionMode(QPainter::CompositionMode_SourceAtop);
    258 #endif /* Q_WS_WIN */
     258#endif /* VBOX_WITH_TRANSLUCENT_SEAMLESS && Q_WS_WIN */
    259259
    260260            /* Draw image rectangle depending on rectangle width: */
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineWindow.h

    r47478 r48705  
    6262    CMachine machine() const;
    6363
     64#ifndef VBOX_WITH_TRANSLUCENT_SEAMLESS
    6465    /* Virtual caller for base class setMask: */
    6566    virtual void setMask(const QRegion &region);
     67#endif /* !VBOX_WITH_TRANSLUCENT_SEAMLESS */
    6668
    6769protected slots:
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/seamless/UIMachineWindowSeamless.cpp

    r47478 r48705  
    9292    setAttribute(Qt::WA_NoSystemBackground);
    9393
    94 #ifdef Q_WS_WIN
    95     /* Using Qt API to enable translucent background for the Win host.
    96      * - Under Mac host Qt doesn't allows to disable window-shadows
    97      *   until version 4.8, but minimum supported version is 4.7.1 for now.
    98      * - Under x11 host Qt 4.8.3 has it broken wih KDE 4.9 for now: */
    99     setAttribute(Qt::WA_TranslucentBackground);
    100 #endif /* Q_WS_WIN */
    101 
    102 #ifdef Q_WS_MAC
     94#ifdef VBOX_WITH_TRANSLUCENT_SEAMLESS
     95# ifdef Q_WS_MAC
    10396    /* Using native API to enable translucent background for the Mac host.
    10497     * - We also want to disable window-shadows which is possible
     
    10699     *   while minimum supported version is 4.7.1 for now: */
    107100    ::darwinSetShowsWindowTransparent(this, true);
    108 #endif /* Q_WS_MAC */
     101# else /* Q_WS_MAC */
     102    /* Using Qt API to enable translucent background:
     103     * - Under Win host Qt conflicts with 3D stuff (black seamless regions).
     104     * - Under Mac host Qt doesn't allows to disable window-shadows
     105     *   until version 4.8, but minimum supported version is 4.7.1 for now.
     106     * - Under x11 host Qt has it broken with KDE 4.9 (black background): */
     107    setAttribute(Qt::WA_TranslucentBackground);
     108# endif /* !Q_WS_MAC */
     109#endif /* VBOX_WITH_TRANSLUCENT_SEAMLESS */
    109110
    110111#ifndef Q_WS_MAC
     
    258259#endif /* !Q_WS_MAC */
    259260
    260 #ifdef Q_WS_WIN
     261#if defined(VBOX_WITH_TRANSLUCENT_SEAMLESS) && defined(Q_WS_WIN)
    261262void UIMachineWindowSeamless::showEvent(QShowEvent*)
    262263{
     
    268269    QApplication::postEvent(this, new QEvent(QEvent::UpdateRequest), Qt::LowEventPriority);
    269270}
    270 #endif /* Q_WS_WIN */
    271 
    272 #ifdef Q_WS_X11
     271#endif /* VBOX_WITH_TRANSLUCENT_SEAMLESS && Q_WS_WIN */
     272
     273#ifndef VBOX_WITH_TRANSLUCENT_SEAMLESS
    273274void UIMachineWindowSeamless::setMask(const QRegion &region)
    274275{
     
    303304    }
    304305}
    305 #endif /* Q_WS_X11 */
    306 
     306#endif /* !VBOX_WITH_TRANSLUCENT_SEAMLESS */
     307
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/seamless/UIMachineWindowSeamless.h

    r46256 r48705  
    7474#endif /* !Q_WS_MAC */
    7575
    76 #ifdef Q_WS_WIN
     76#if defined(VBOX_WITH_TRANSLUCENT_SEAMLESS) && defined(Q_WS_WIN)
    7777    /* Handler: Translucency stuff: */
    7878    void showEvent(QShowEvent *pEvent);
    79 #endif /* Q_WS_WIN */
     79#endif /* VBOX_WITH_TRANSLUCENT_SEAMLESS && Q_WS_WIN */
    8080
    81 #ifdef Q_WS_X11
     81#ifndef VBOX_WITH_TRANSLUCENT_SEAMLESS
    8282    /* Helper: Masking stuff: */
    8383    void setMask(const QRegion &region);
    84 #endif /* Q_WS_X11 */
     84#endif /* !VBOX_WITH_TRANSLUCENT_SEAMLESS */
    8585
    8686    /* Widgets: */
     
    9090#endif /* !Q_WS_MAC */
    9191
    92 #ifdef Q_WS_X11
     92#ifndef VBOX_WITH_TRANSLUCENT_SEAMLESS
    9393    /* Variable: Masking stuff: */
    9494    QRegion m_maskRegion;
    95 #endif /* Q_WS_X11 */
     95#endif /* !VBOX_WITH_TRANSLUCENT_SEAMLESS */
    9696
    9797    /* Factory support: */
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