diff --git a/kstyle/breezehelper.h b/kstyle/breezehelper.h --- a/kstyle/breezehelper.h +++ b/kstyle/breezehelper.h @@ -31,10 +31,6 @@ #include #include -#if BREEZE_HAVE_X11 -#include -#endif - namespace Breeze { @@ -288,18 +284,6 @@ //@} - //*@name X11 utilities - //@{ - - #if BREEZE_HAVE_X11 - - //* create xcb atom - xcb_atom_t createAtom( const QString& ) const; - - #endif - - //@} - //* frame radius constexpr qreal frameRadius( const int penWidth = PenWidth::NoPen, const qreal bias = 0 ) const { return qMax( Metrics::Frame_FrameRadius - (0.5 * penWidth) + bias, 0.0 ); } @@ -316,9 +300,6 @@ protected: - //* initialize - void init(); - //* return rounded path in a given rect, with only selected corners rounded, and for a given radius QPainterPath roundedPath( const QRectF&, Corners, qreal ) const; @@ -342,13 +323,6 @@ QColor _inactiveTitleBarTextColor; //@} - #if BREEZE_HAVE_X11 - - //* atom used for compositing manager - xcb_atom_t _compositingManagerAtom; - - #endif - }; } diff --git a/kstyle/breezehelper.cpp b/kstyle/breezehelper.cpp --- a/kstyle/breezehelper.cpp +++ b/kstyle/breezehelper.cpp @@ -43,7 +43,7 @@ //____________________________________________________________________ Helper::Helper( KSharedConfig::Ptr config ): _config( std::move( config ) ) - { init(); } + {} //____________________________________________________________________ KSharedConfig::Ptr Helper::config() const @@ -1577,13 +1577,7 @@ #if BREEZE_HAVE_X11 if( isX11() ) - { - // direct call to X - xcb_get_selection_owner_cookie_t cookie( xcb_get_selection_owner( QX11Info::connection(), _compositingManagerAtom ) ); - ScopedPointer reply( xcb_get_selection_owner_reply( QX11Info::connection(), cookie, nullptr ) ); - return reply && reply->owner; - - } + { return QX11Info::isCompositingManagerRunning( QX11Info::appScreen() ); } #endif // use KWindowSystem @@ -1610,39 +1604,4 @@ return pixmap.devicePixelRatio(); } - #if BREEZE_HAVE_X11 - - //____________________________________________________________________ - xcb_atom_t Helper::createAtom( const QString& name ) const - { - if( isX11() ) - { - - xcb_connection_t* connection( QX11Info::connection() ); - xcb_intern_atom_cookie_t cookie( xcb_intern_atom( connection, false, name.size(), qPrintable( name ) ) ); - ScopedPointer reply( xcb_intern_atom_reply( connection, cookie, nullptr) ); - return reply ? reply->atom:0; - - } else return 0; - - } - - #endif - - //____________________________________________________________________ - void Helper::init() - { - #if BREEZE_HAVE_X11 - - if( isX11() ) - { - // create compositing screen - const QString atomName( QStringLiteral( "_NET_WM_CM_S%1" ).arg( QX11Info::appScreen() ) ); - _compositingManagerAtom = createAtom( atomName ); - } - - #endif - - } - }