Changeset View
Changeset View
Standalone View
Standalone View
effects/highlightwindow/highlightwindow.cpp
Show All 27 Lines | 26 | HighlightWindowEffect::HighlightWindowEffect() | |||
---|---|---|---|---|---|
28 | , m_fadeDuration(float(animationTime(150))) | 28 | , m_fadeDuration(float(animationTime(150))) | ||
29 | , m_monitorWindow(NULL) | 29 | , m_monitorWindow(NULL) | ||
30 | { | 30 | { | ||
31 | m_atom = effects->announceSupportProperty("_KDE_WINDOW_HIGHLIGHT", this); | 31 | m_atom = effects->announceSupportProperty("_KDE_WINDOW_HIGHLIGHT", this); | ||
32 | connect(effects, SIGNAL(windowAdded(KWin::EffectWindow*)), this, SLOT(slotWindowAdded(KWin::EffectWindow*))); | 32 | connect(effects, SIGNAL(windowAdded(KWin::EffectWindow*)), this, SLOT(slotWindowAdded(KWin::EffectWindow*))); | ||
33 | connect(effects, SIGNAL(windowClosed(KWin::EffectWindow*)), this, SLOT(slotWindowClosed(KWin::EffectWindow*))); | 33 | connect(effects, SIGNAL(windowClosed(KWin::EffectWindow*)), this, SLOT(slotWindowClosed(KWin::EffectWindow*))); | ||
34 | connect(effects, SIGNAL(windowDeleted(KWin::EffectWindow*)), this, SLOT(slotWindowDeleted(KWin::EffectWindow*))); | 34 | connect(effects, SIGNAL(windowDeleted(KWin::EffectWindow*)), this, SLOT(slotWindowDeleted(KWin::EffectWindow*))); | ||
35 | connect(effects, SIGNAL(propertyNotify(KWin::EffectWindow*,long)), this, SLOT(slotPropertyNotify(KWin::EffectWindow*,long))); | 35 | connect(effects, SIGNAL(propertyNotify(KWin::EffectWindow*,long)), this, SLOT(slotPropertyNotify(KWin::EffectWindow*,long))); | ||
36 | connect(effects, &EffectsHandler::xcbConnectionChanged, this, | ||||
37 | [this] { | ||||
38 | m_atom = effects->announceSupportProperty("_KDE_WINDOW_HIGHLIGHT", this); | ||||
39 | } | ||||
40 | ); | ||||
36 | } | 41 | } | ||
37 | 42 | | |||
38 | HighlightWindowEffect::~HighlightWindowEffect() | 43 | HighlightWindowEffect::~HighlightWindowEffect() | ||
39 | { | 44 | { | ||
40 | } | 45 | } | ||
41 | 46 | | |||
42 | static bool isInitiallyHidden(EffectWindow* w) | 47 | static bool isInitiallyHidden(EffectWindow* w) | ||
43 | { | 48 | { | ||
▲ Show 20 Lines • Show All 82 Lines • ▼ Show 20 Line(s) | |||||
126 | 131 | | |||
127 | void HighlightWindowEffect::slotWindowDeleted(EffectWindow* w) | 132 | void HighlightWindowEffect::slotWindowDeleted(EffectWindow* w) | ||
128 | { | 133 | { | ||
129 | m_windowOpacity.remove(w); | 134 | m_windowOpacity.remove(w); | ||
130 | } | 135 | } | ||
131 | 136 | | |||
132 | void HighlightWindowEffect::slotPropertyNotify(EffectWindow* w, long a, EffectWindow *addedWindow) | 137 | void HighlightWindowEffect::slotPropertyNotify(EffectWindow* w, long a, EffectWindow *addedWindow) | ||
133 | { | 138 | { | ||
134 | if (a != m_atom) | 139 | if (a != m_atom || m_atom == XCB_ATOM_NONE) | ||
135 | return; // Not our atom | 140 | return; // Not our atom | ||
136 | 141 | | |||
137 | // if the window is null, the property was set on the root window - see events.cpp | 142 | // if the window is null, the property was set on the root window - see events.cpp | ||
138 | QByteArray byteData = w ? w->readProperty(m_atom, m_atom, 32) : | 143 | QByteArray byteData = w ? w->readProperty(m_atom, m_atom, 32) : | ||
139 | effects->readRootProperty(m_atom, m_atom, 32); | 144 | effects->readRootProperty(m_atom, m_atom, 32); | ||
140 | if (byteData.length() < 1) { | 145 | if (byteData.length() < 1) { | ||
141 | // Property was removed, clearing highlight | 146 | // Property was removed, clearing highlight | ||
142 | if (!addedWindow || w != addedWindow) | 147 | if (!addedWindow || w != addedWindow) | ||
▲ Show 20 Lines • Show All 162 Lines • Show Last 20 Lines |