Changeset View
Changeset View
Standalone View
Standalone View
kstyle/breezehelper.cpp
Show All 22 Lines | |||||
23 | #include "breezestyleconfigdata.h" | 23 | #include "breezestyleconfigdata.h" | ||
24 | 24 | | |||
25 | #include <KColorUtils> | 25 | #include <KColorUtils> | ||
26 | #include <KWindowSystem> | 26 | #include <KWindowSystem> | ||
27 | 27 | | |||
28 | #include <QApplication> | 28 | #include <QApplication> | ||
29 | #include <QPainter> | 29 | #include <QPainter> | ||
30 | 30 | | |||
31 | #if BREEZE_HAVE_X11 | ||||
32 | #include <QX11Info> | ||||
33 | #endif | ||||
34 | | ||||
31 | #include <algorithm> | 35 | #include <algorithm> | ||
32 | 36 | | |||
33 | namespace Breeze | 37 | namespace Breeze | ||
34 | { | 38 | { | ||
35 | 39 | | |||
36 | //* contrast for arrow and treeline rendering | 40 | //* contrast for arrow and treeline rendering | ||
37 | static const qreal arrowShade = 0.15; | 41 | static const qreal arrowShade = 0.15; | ||
38 | 42 | | |||
▲ Show 20 Lines • Show All 1531 Lines • ▼ Show 20 Line(s) | 1327 | } | |||
1570 | //________________________________________________________________________________________________________ | 1574 | //________________________________________________________________________________________________________ | ||
1571 | bool Helper::compositingActive() const | 1575 | bool Helper::compositingActive() const | ||
1572 | { | 1576 | { | ||
1573 | 1577 | | |||
1574 | #if BREEZE_HAVE_X11 | 1578 | #if BREEZE_HAVE_X11 | ||
1575 | if( isX11() ) | 1579 | if( isX11() ) | ||
1576 | { | 1580 | { | ||
1577 | // direct call to X | 1581 | // direct call to X | ||
1578 | xcb_get_selection_owner_cookie_t cookie( xcb_get_selection_owner( connection(), _compositingManagerAtom ) ); | 1582 | xcb_get_selection_owner_cookie_t cookie( xcb_get_selection_owner( QX11Info::connection(), _compositingManagerAtom ) ); | ||
1579 | ScopedPointer<xcb_get_selection_owner_reply_t> reply( xcb_get_selection_owner_reply( connection(), cookie, nullptr ) ); | 1583 | ScopedPointer<xcb_get_selection_owner_reply_t> reply( xcb_get_selection_owner_reply( QX11Info::connection(), cookie, nullptr ) ); | ||
1580 | return reply && reply->owner; | 1584 | return reply && reply->owner; | ||
1581 | 1585 | | |||
1582 | } | 1586 | } | ||
1583 | #endif | 1587 | #endif | ||
1584 | 1588 | | |||
1585 | // use KWindowSystem | 1589 | // use KWindowSystem | ||
1586 | return KWindowSystem::compositingActive(); | 1590 | return KWindowSystem::compositingActive(); | ||
1587 | 1591 | | |||
Show All 16 Lines | |||||
1604 | qreal Helper::devicePixelRatio( const QPixmap& pixmap ) const | 1608 | qreal Helper::devicePixelRatio( const QPixmap& pixmap ) const | ||
1605 | { | 1609 | { | ||
1606 | return pixmap.devicePixelRatio(); | 1610 | return pixmap.devicePixelRatio(); | ||
1607 | } | 1611 | } | ||
1608 | 1612 | | |||
1609 | #if BREEZE_HAVE_X11 | 1613 | #if BREEZE_HAVE_X11 | ||
1610 | 1614 | | |||
1611 | //____________________________________________________________________ | 1615 | //____________________________________________________________________ | ||
1612 | xcb_connection_t* Helper::connection() | | |||
1613 | { | | |||
1614 | | ||||
1615 | return QX11Info::connection(); | | |||
1616 | } | | |||
1617 | | ||||
1618 | //____________________________________________________________________ | | |||
1619 | xcb_atom_t Helper::createAtom( const QString& name ) const | 1616 | xcb_atom_t Helper::createAtom( const QString& name ) const | ||
1620 | { | 1617 | { | ||
1621 | if( isX11() ) | 1618 | if( isX11() ) | ||
1622 | { | 1619 | { | ||
1623 | 1620 | | |||
1624 | xcb_connection_t* connection( Helper::connection() ); | 1621 | xcb_connection_t* connection( QX11Info::connection() ); | ||
1625 | xcb_intern_atom_cookie_t cookie( xcb_intern_atom( connection, false, name.size(), qPrintable( name ) ) ); | 1622 | xcb_intern_atom_cookie_t cookie( xcb_intern_atom( connection, false, name.size(), qPrintable( name ) ) ); | ||
1626 | ScopedPointer<xcb_intern_atom_reply_t> reply( xcb_intern_atom_reply( connection, cookie, nullptr) ); | 1623 | ScopedPointer<xcb_intern_atom_reply_t> reply( xcb_intern_atom_reply( connection, cookie, nullptr) ); | ||
1627 | return reply ? reply->atom:0; | 1624 | return reply ? reply->atom:0; | ||
1628 | 1625 | | |||
1629 | } else return 0; | 1626 | } else return 0; | ||
1630 | 1627 | | |||
1631 | } | 1628 | } | ||
1632 | 1629 | | |||
Show All 19 Lines |