Changeset 197f54a2b9 in tspsg for src


Ignore:
Timestamp:
Sep 12, 2012, 6:55:57 PM (12 years ago)
Author:
Oleksii Serdiuk
Branches:
appveyor, imgbot, master, readme
Children:
545591d1a9
Parents:
89e5214692
Message:

No QX11Info class in Qt 5.

Replaced all usage of QX11Info with direct access to X11 API. More
reliable detection of X11 in Qt 5 might be needed.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/qtwin.cpp

    r89e5214692 r197f54a2b9  
    1515#include <QPointer>
    1616
     17//! \todo TODO: Detect X11 in Qt 5 more reliably
     18// No Q_WS_X11 in Qt 5. Check if we're using X11 and define it.
     19#if (QT_VERSION >= QT_VERSION_CHECK(5,0,0)) && defined(Q_OS_UNIX) && !defined(Q_WS_X11)
     20#   if !defined(Q_OS_MAC) && !defined(Q_OS_SYMBIAN) && !defined(Q_WS_QPA)
     21#       define Q_WS_X11
     22#   endif
     23#endif
     24
    1725#ifdef Q_WS_X11
    18 #include <QX11Info>
     26#include <X11/Xlib.h>
    1927#endif // Q_WS_X11
    2028
     
    109117    return false;
    110118#elif defined(Q_WS_X11)
    111     return QX11Info::isCompositingManagerRunning();
     119    Display *d = XOpenDisplay(NULL);
     120    Atom _NET_WM_CM_S0 = XInternAtom(d, "_NET_WM_CM_S0", true);
     121    bool result = (_NET_WM_CM_S0 != None);
     122    if (result)
     123        result = (XGetSelectionOwner(d, _NET_WM_CM_S0) != None);
     124    XCloseDisplay(d);
     125    return result;
    112126#else
    113127    //! \todo TODO: Check for trsnsparency support in other OSes.
Note: See TracChangeset for help on using the changeset viewer.