Commit 56f36bec authored by Lucas Murray's avatar Lucas Murray

Deactivate window highlight immediately after the window is closed or if

the X window property is deleted.

svn path=/trunk/KDE/kdebase/workspace/; revision=923779
parent 298586b6
......@@ -99,13 +99,17 @@ void HighlightWindowEffect::windowAdded( EffectWindow* w )
propertyNotify( w, m_atom ); // Check initial value
}
void HighlightWindowEffect::windowDeleted( EffectWindow* w )
void HighlightWindowEffect::windowClosed( EffectWindow* w )
{
m_windowOpacity.remove( w );
if( m_monitorWindow == w ) // The monitoring window was destroyed
finishHighlighting();
}
void HighlightWindowEffect::windowDeleted( EffectWindow* w )
{
m_windowOpacity.remove( w );
}
void HighlightWindowEffect::propertyNotify( EffectWindow* w, long a )
{
if( a != m_atom )
......@@ -113,11 +117,14 @@ void HighlightWindowEffect::propertyNotify( EffectWindow* w, long a )
QByteArray byteData = w->readProperty( m_atom, m_atom, 32 );
if( byteData.length() < 1 )
return; // Invalid length
{ // Property was removed, clearing highlight
finishHighlighting();
return;
}
long* data = reinterpret_cast<long*>( byteData.data() );
if( !data[0] )
{ // Purposely clearing highlight
{ // Purposely clearing highlight by issuing a NULL target
finishHighlighting();
return;
}
......
......@@ -37,6 +37,7 @@ class HighlightWindowEffect
virtual void paintWindow( EffectWindow* w, int mask, QRegion region, WindowPaintData& data );
virtual void windowAdded( EffectWindow* w );
virtual void windowClosed( EffectWindow* w );
virtual void windowDeleted( EffectWindow* w );
virtual void propertyNotify( EffectWindow* w, long atom );
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment