From 20a2c36677c8cf424954aa6b037cfb92d4fe08b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lubo=C5=A1=20Lu=C5=88=C3=A1k?= Date: Mon, 28 Jul 2008 11:49:43 +0000 Subject: [PATCH] Discard Deleted windows when finishing compositing, so that they're not reused if compositing is started again. BUG: 152914 svn path=/trunk/KDE/kdebase/workspace/; revision=838646 --- composite.cpp | 3 +++ deleted.cpp | 7 +++++++ deleted.h | 1 + 3 files changed, 11 insertions(+) diff --git a/composite.cpp b/composite.cpp index bb080c53cc..b45a0deb09 100644 --- a/composite.cpp +++ b/composite.cpp @@ -253,6 +253,9 @@ void Workspace::finishCompositing() } delete popup; // force re-creation of the Alt+F3 popup (opacity option) popup = NULL; + // discard all Deleted windows (#152914) + while( !deleted.isEmpty()) + deleted.first()->discard( Allowed ); #endif } diff --git a/deleted.cpp b/deleted.cpp index 2683e1e900..4e97a76d20 100644 --- a/deleted.cpp +++ b/deleted.cpp @@ -48,6 +48,13 @@ Deleted* Deleted::create( Toplevel* c ) return d; } +// to be used only from Workspace::finishCompositing() +void Deleted::discard( allowed_t ) + { + delete_refcount = 0; + delete this; + } + void Deleted::copyToDeleted( Toplevel* c ) { assert( dynamic_cast< Deleted* >( c ) == NULL ); diff --git a/deleted.h b/deleted.h index 763f207a28..9483d6ff92 100644 --- a/deleted.h +++ b/deleted.h @@ -35,6 +35,7 @@ class Deleted // used by effects to keep the window around for e.g. fadeout effects when it's destroyed void refWindow(); void unrefWindow( bool delay = false ); + void discard( allowed_t ); virtual int desktop() const; virtual QPoint clientPos() const; virtual QSize clientSize() const;