VirtualBox

Changeset 58880 in vbox


Ignore:
Timestamp:
Nov 26, 2015 1:05:13 PM (9 years ago)
Author:
vboxsync
Message:

FE/Qt: Qt5 migration (part 20): QX11Info API changes.

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

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UIDesktopWidgetWatchdog.cpp

    r57510 r58880  
    1919#include <QApplication>
    2020#include <QDesktopWidget>
    21 #ifdef Q_WS_X11
    22 # include <QX11Info>
    23 #endif /* Q_WS_X11 */
    2421
    2522/* GUI includes: */
     23#include "VBoxGlobal.h"
    2624#include "UIDesktopWidgetWatchdog.h"
    2725
    2826/* Other VBox includes: */
    2927#include <iprt/assert.h>
     28
    3029
    3130/** QWidget extension used as
     
    6766#ifdef Q_WS_X11
    6867    /* For composite WMs make this 1 pixel transparent: */
    69     if (QX11Info::isCompositingManagerRunning())
     68    if (vboxGlobal().isCompositingManagerRunning())
    7069        setAttribute(Qt::WA_TranslucentBackground);
    7170#else /* !Q_WS_X11 */
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/VBoxGlobal.cpp

    r58866 r58880  
    231231    , m_pMediumEnumerator(0)
    232232#ifdef Q_WS_X11
     233    , m_fCompositingManagerRunning(false)
    233234    , m_enmWindowManagerType(X11WMType_Unknown)
    234235    , m_pDesktopWidgetWatchdog(0)
     
    33653366bool VBoxGlobal::setFullScreenMonitorX11(QWidget *pWidget, ulong uScreenId)
    33663367{
    3367     return XXSendClientMessage(pWidget->x11Info().display(),
     3368    return XXSendClientMessage(QX11Info::display(),
    33683369                               pWidget->window()->winId(),
    33693370                               "_NET_WM_FULLSCREEN_MONITORS",
     
    33763377{
    33773378    /* Get display: */
    3378     Display *pDisplay = pWidget->x11Info().display();
     3379    Display *pDisplay = QX11Info::display();
    33793380
    33803381    /* Prepare atoms: */
     
    34203421{
    34213422    /* Get display: */
    3422     Display *pDisplay = pWidget->x11Info().display();
     3423    Display *pDisplay = QX11Info::display();
    34233424
    34243425    /* Prepare atoms: */
     
    34333434{
    34343435    /* Get display: */
    3435     Display *pDisplay = pWidget->x11Info().display();
     3436    Display *pDisplay = QX11Info::display();
    34363437
    34373438    /* Prepare atoms: */
     
    40484049
    40494050#ifdef Q_WS_X11
     4051    /* Check whether we have compositing manager running: */
     4052    m_fCompositingManagerRunning = X11IsCompositingManagerRunning();
     4053
    40504054    /* Acquire current Window Manager type: */
    40514055    m_enmWindowManagerType = X11WindowManagerType();
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/VBoxGlobal.h

    r58360 r58880  
    207207
    208208#ifdef Q_WS_X11
     209    /** X11: Returns whether the Window Manager we are running at is composition one. */
     210    bool isCompositingManagerRunning() const { return m_fCompositingManagerRunning; }
    209211    /** X11: Returns the type of the Window Manager we are running under. */
    210212    X11WMType typeOfWindowManager() const { return m_enmWindowManagerType; }
     
    568570
    569571#ifdef Q_WS_X11
     572    /** X11: Holds whether the Window Manager we are running at is composition one. */
     573    bool m_fCompositingManagerRunning;
    570574    /** X11: Holds the type of the Window Manager we are running under. */
    571575    X11WMType m_enmWindowManagerType;
  • trunk/src/VBox/Frontends/VirtualBox/src/platform/x11/VBoxX11Helper.cpp

    r57101 r58880  
    3636static BOOL gX11ScreenSaverDpmsAvailable;
    3737static BOOL gX11DpmsState;
     38
     39bool X11IsCompositingManagerRunning()
     40{
     41    /* Get display: */
     42    Display *pDisplay = QX11Info::display();
     43    /* For each screen it manage, compositing manager MUST acquire ownership
     44     * of a selection named _NET_WM_CM_Sn, where n is the screen number. */
     45    Atom atom_property_name = XInternAtom(pDisplay, "_NET_WM_CM_S0", True);
     46    return XGetSelectionOwner(pDisplay, atom_property_name);
     47}
    3848
    3949X11WMType X11WindowManagerType()
  • trunk/src/VBox/Frontends/VirtualBox/src/platform/x11/VBoxX11Helper.h

    r57101 r58880  
    3030};
    3131
     32/** X11: Determines and returns whether the compositing manager is running. */
     33bool X11IsCompositingManagerRunning();
     34
    3235/** X11: Determines and returns current Window Manager type. */
    3336X11WMType X11WindowManagerType();
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UISlidingToolBar.cpp

    r52786 r58880  
    2424# include <QHBoxLayout>
    2525# include <QMdiArea>
    26 # ifdef Q_WS_X11
    27 #  include <QX11Info>
    28 # endif /* Q_WS_X11 */
    2926
    3027/* GUI includes: */
     28# include "VBoxGlobal.h"
    3129# include "UISlidingToolBar.h"
    3230# include "UIAnimationFramework.h"
     
    8078    setAttribute(Qt::WA_TranslucentBackground);
    8179#elif defined(Q_WS_X11)
    82     if (QX11Info::isCompositingManagerRunning())
     80    if (vboxGlobal().isCompositingManagerRunning())
    8381    {
    8482        /* Use Qt API to enable translucency: */
     
    157155
    158156#ifdef Q_WS_X11
    159     if (!QX11Info::isCompositingManagerRunning())
     157    if (!vboxGlobal().isCompositingManagerRunning())
    160158    {
    161159        /* Use Xshape otherwise: */
     
    214212
    215213#ifdef Q_WS_X11
    216     if (!QX11Info::isCompositingManagerRunning())
     214    if (!vboxGlobal().isCompositingManagerRunning())
    217215    {
    218216        /* Use Xshape otherwise: */
     
    306304
    307305#ifdef Q_WS_X11
    308     if (!QX11Info::isCompositingManagerRunning())
     306    if (!vboxGlobal().isCompositingManagerRunning())
    309307    {
    310308        /* Use Xshape otherwise: */
  • trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIMiniToolBar.cpp

    r57591 r58880  
    3030# include <QStateMachine>
    3131# include <QPainter>
    32 # ifdef Q_WS_X11
    33 #  include <QX11Info>
    34 # endif /* Q_WS_X11 */
    3532
    3633/* GUI includes: */
     
    276273    /* Left margin: */
    277274#ifdef Q_WS_X11
    278     if (QX11Info::isCompositingManagerRunning())
     275    if (vboxGlobal().isCompositingManagerRunning())
    279276        m_spacings << widgetForAction(addWidget(new QWidget));
    280277#else /* !Q_WS_X11 */
     
    331328    /* Right margin: */
    332329#ifdef Q_WS_X11
    333     if (QX11Info::isCompositingManagerRunning())
     330    if (vboxGlobal().isCompositingManagerRunning())
    334331        m_spacings << widgetForAction(addWidget(new QWidget));
    335332#else /* !Q_WS_X11 */
     
    344341{
    345342#ifdef Q_WS_X11
    346     if (!QX11Info::isCompositingManagerRunning())
     343    if (!vboxGlobal().isCompositingManagerRunning())
    347344        return;
    348345#endif /* Q_WS_X11 */
     
    553550#elif defined(Q_WS_X11)
    554551    /* Enable translucency through Qt API if supported: */
    555     if (QX11Info::isCompositingManagerRunning())
     552    if (vboxGlobal().isCompositingManagerRunning())
    556553        setAttribute(Qt::WA_TranslucentBackground);
    557554#endif /* Q_WS_X11 */
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