diff --git a/kstyle/breezehelper.h b/kstyle/breezehelper.h --- a/kstyle/breezehelper.h +++ b/kstyle/breezehelper.h @@ -31,11 +31,6 @@ #include #include -#if BREEZE_HAVE_X11 -#include -#include -#endif - namespace Breeze { @@ -289,21 +284,6 @@ //@} - //*@name X11 utilities - //@{ - - #if BREEZE_HAVE_X11 - - //* get xcb connection - static xcb_connection_t* connection(); - - //* 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 ); } @@ -320,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; @@ -346,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 @@ -28,6 +28,10 @@ #include #include +#if BREEZE_HAVE_X11 +#include +#endif + #include namespace Breeze @@ -39,7 +43,7 @@ //____________________________________________________________________ Helper::Helper( KSharedConfig::Ptr config ): _config( std::move( config ) ) - { init(); } + {} //____________________________________________________________________ KSharedConfig::Ptr Helper::config() const @@ -1573,13 +1577,7 @@ #if BREEZE_HAVE_X11 if( isX11() ) - { - // direct call to X - xcb_get_selection_owner_cookie_t cookie( xcb_get_selection_owner( connection(), _compositingManagerAtom ) ); - ScopedPointer reply( xcb_get_selection_owner_reply( connection(), cookie, nullptr ) ); - return reply && reply->owner; - - } + { return QX11Info::isCompositingManagerRunning(QX11Info::appScreen()); } #endif // use KWindowSystem @@ -1606,46 +1604,4 @@ return pixmap.devicePixelRatio(); } - #if BREEZE_HAVE_X11 - - //____________________________________________________________________ - xcb_connection_t* Helper::connection() - { - - return QX11Info::connection(); - } - - //____________________________________________________________________ - xcb_atom_t Helper::createAtom( const QString& name ) const - { - if( isX11() ) - { - - xcb_connection_t* connection( Helper::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 - - } - } diff --git a/kstyle/breezewindowmanager.cpp b/kstyle/breezewindowmanager.cpp --- a/kstyle/breezewindowmanager.cpp +++ b/kstyle/breezewindowmanager.cpp @@ -846,7 +846,7 @@ { #if BREEZE_HAVE_X11 // connection - auto connection( Helper::connection() ); + auto connection( QX11Info::connection() ); auto net_connection = connection; const qreal dpiRatio = window->devicePixelRatio();