Changeset View
Changeset View
Standalone View
Standalone View
effects.cpp
Show First 20 Lines • Show All 84 Lines • ▼ Show 20 Line(s) | 69 | { | |||
---|---|---|---|---|---|
85 | } | 85 | } | ||
86 | } | 86 | } | ||
87 | 87 | | |||
88 | static void deleteWindowProperty(Window win, long int atom) | 88 | static void deleteWindowProperty(Window win, long int atom) | ||
89 | { | 89 | { | ||
90 | if (win == XCB_WINDOW_NONE) { | 90 | if (win == XCB_WINDOW_NONE) { | ||
91 | return; | 91 | return; | ||
92 | } | 92 | } | ||
93 | xcb_delete_property(connection(), win, atom); | 93 | xcb_delete_property(kwinApp()->x11Connection(), win, atom); | ||
94 | } | 94 | } | ||
95 | 95 | | |||
96 | static xcb_atom_t registerSupportProperty(const QByteArray &propertyName) | 96 | static xcb_atom_t registerSupportProperty(const QByteArray &propertyName) | ||
97 | { | 97 | { | ||
98 | auto c = kwinApp()->x11Connection(); | 98 | auto c = kwinApp()->x11Connection(); | ||
99 | if (!c) { | 99 | if (!c) { | ||
100 | return XCB_ATOM_NONE; | 100 | return XCB_ATOM_NONE; | ||
101 | } | 101 | } | ||
▲ Show 20 Lines • Show All 760 Lines • ▼ Show 20 Line(s) | 847 | { | |||
862 | const xcb_atom_t atom = m_managedProperties.take(propertyName); | 862 | const xcb_atom_t atom = m_managedProperties.take(propertyName); | ||
863 | registerPropertyType(atom, false); | 863 | registerPropertyType(atom, false); | ||
864 | m_propertiesForEffects.remove(propertyName); | 864 | m_propertiesForEffects.remove(propertyName); | ||
865 | m_compositor->removeSupportProperty(atom); // delayed removal | 865 | m_compositor->removeSupportProperty(atom); // delayed removal | ||
866 | } | 866 | } | ||
867 | 867 | | |||
868 | QByteArray EffectsHandlerImpl::readRootProperty(long atom, long type, int format) const | 868 | QByteArray EffectsHandlerImpl::readRootProperty(long atom, long type, int format) const | ||
869 | { | 869 | { | ||
870 | return readWindowProperty(rootWindow(), atom, type, format); | 870 | if (!kwinApp()->x11Connection()) { | ||
871 | return QByteArray(); | ||||
872 | } | ||||
873 | return readWindowProperty(kwinApp()->x11RootWindow(), atom, type, format); | ||||
871 | } | 874 | } | ||
872 | 875 | | |||
873 | void EffectsHandlerImpl::activateWindow(EffectWindow* c) | 876 | void EffectsHandlerImpl::activateWindow(EffectWindow* c) | ||
874 | { | 877 | { | ||
875 | if (AbstractClient* cl = dynamic_cast< AbstractClient* >(static_cast<EffectWindowImpl*>(c)->window())) | 878 | if (AbstractClient* cl = dynamic_cast< AbstractClient* >(static_cast<EffectWindowImpl*>(c)->window())) | ||
876 | Workspace::self()->activateClient(cl, true); | 879 | Workspace::self()->activateClient(cl, true); | ||
877 | } | 880 | } | ||
878 | 881 | | |||
▲ Show 20 Lines • Show All 853 Lines • ▼ Show 20 Line(s) | |||||
1732 | QRect EffectWindowImpl::decorationInnerRect() const | 1735 | QRect EffectWindowImpl::decorationInnerRect() const | ||
1733 | { | 1736 | { | ||
1734 | Client *client = dynamic_cast<Client*>(toplevel); | 1737 | Client *client = dynamic_cast<Client*>(toplevel); | ||
1735 | return client ? client->transparentRect() : contentsRect(); | 1738 | return client ? client->transparentRect() : contentsRect(); | ||
1736 | } | 1739 | } | ||
1737 | 1740 | | |||
1738 | QByteArray EffectWindowImpl::readProperty(long atom, long type, int format) const | 1741 | QByteArray EffectWindowImpl::readProperty(long atom, long type, int format) const | ||
1739 | { | 1742 | { | ||
1743 | if (!kwinApp()->x11Connection()) { | ||||
1744 | return QByteArray(); | ||||
1745 | } | ||||
1740 | return readWindowProperty(window()->window(), atom, type, format); | 1746 | return readWindowProperty(window()->window(), atom, type, format); | ||
1741 | } | 1747 | } | ||
1742 | 1748 | | |||
1743 | void EffectWindowImpl::deleteProperty(long int atom) const | 1749 | void EffectWindowImpl::deleteProperty(long int atom) const | ||
1744 | { | 1750 | { | ||
1751 | if (kwinApp()->x11Connection()) { | ||||
1745 | deleteWindowProperty(window()->window(), atom); | 1752 | deleteWindowProperty(window()->window(), atom); | ||
1746 | } | 1753 | } | ||
1754 | } | ||||
1747 | 1755 | | |||
1748 | EffectWindow* EffectWindowImpl::findModal() | 1756 | EffectWindow* EffectWindowImpl::findModal() | ||
1749 | { | 1757 | { | ||
1750 | if (AbstractClient* c = dynamic_cast< AbstractClient* >(toplevel)) { | 1758 | if (AbstractClient* c = dynamic_cast< AbstractClient* >(toplevel)) { | ||
1751 | if (AbstractClient* c2 = c->findModal()) | 1759 | if (AbstractClient* c2 = c->findModal()) | ||
1752 | return c2->effectWindow(); | 1760 | return c2->effectWindow(); | ||
1753 | } | 1761 | } | ||
1754 | return NULL; | 1762 | return NULL; | ||
▲ Show 20 Lines • Show All 370 Lines • Show Last 20 Lines |