From 1bc2f456d9b074447272158063eb66e7e795ad32 Mon Sep 17 00:00:00 2001 From: Lucas Murray Date: Mon, 9 Feb 2009 14:36:47 +0000 Subject: [PATCH] Prevent dim inactive from crashing whenever the previous active window is closed. svn path=/trunk/KDE/kdebase/workspace/; revision=923835 --- effects/diminactive/diminactive.cpp | 6 ++++++ effects/diminactive/diminactive.h | 1 + 2 files changed, 7 insertions(+) diff --git a/effects/diminactive/diminactive.cpp b/effects/diminactive/diminactive.cpp index 9cfe990978..2e5b6f8375 100644 --- a/effects/diminactive/diminactive.cpp +++ b/effects/diminactive/diminactive.cpp @@ -97,6 +97,12 @@ bool DimInactiveEffect::dimWindow( const EffectWindow* w ) const return true; // dim the rest } +void DimInactiveEffect::windowDeleted( EffectWindow* w ) + { + if( w == previousActive ) + previousActive = NULL; + } + void DimInactiveEffect::windowActivated( EffectWindow* w ) { if( active != NULL ) diff --git a/effects/diminactive/diminactive.h b/effects/diminactive/diminactive.h index 9111254c38..ff3915c451 100644 --- a/effects/diminactive/diminactive.h +++ b/effects/diminactive/diminactive.h @@ -37,6 +37,7 @@ class DimInactiveEffect virtual void reconfigure( ReconfigureFlags ); virtual void prePaintScreen( ScreenPrePaintData& data, int time ); virtual void paintWindow( EffectWindow* w, int mask, QRegion region, WindowPaintData& data ); + virtual void windowDeleted( EffectWindow* w ); virtual void windowActivated( EffectWindow* c ); private: bool dimWindow( const EffectWindow* w ) const;