diff --git a/composite.cpp b/composite.cpp index 09220e500e..6104455f5f 100644 --- a/composite.cpp +++ b/composite.cpp @@ -205,8 +205,7 @@ void Workspace::setupCompositing() scene->windowAdded( c ); foreach( Unmanaged* c, unmanaged ) scene->windowAdded( c ); - delete popup; // force re-creation of the Alt+F3 popup (opacity option) - popup = NULL; + discardPopup(); // force re-creation of the Alt+F3 popup (opacity option) #else kDebug( 1212 ) << "Compositing was not available at compile time"; #endif @@ -251,8 +250,7 @@ void Workspace::finishCompositing() i.setOpacity( static_cast< unsigned long >((*it)->opacity() * 0xffffffff )); } } - delete popup; // force re-creation of the Alt+F3 popup (opacity option) - popup = NULL; + discardPopup(); // force re-creation of the Alt+F3 popup (opacity option) // discard all Deleted windows (#152914) while( !deleted.isEmpty()) deleted.first()->discard( Allowed ); diff --git a/useractions.cpp b/useractions.cpp index 9a87e822c2..b3048c5cca 100644 --- a/useractions.cpp +++ b/useractions.cpp @@ -191,6 +191,13 @@ QMenu* Workspace::clientPopup() return popup; } +void Workspace::discardPopup() + { + delete popup; + popup = NULL; + desk_popup = NULL; + } + void Workspace::setPopupClientOpacity( QAction* action ) { if( active_popup_client == NULL ) @@ -359,10 +366,7 @@ void Workspace::readShortcuts() kaction = qobject_cast( keys->action("Walk Through Windows (Reverse)") ); if ( kaction!=0 ) cutWalkThroughWindowsReverse = kaction->globalShortcut(); - - delete popup; - popup = NULL; // so that it's recreated next time - desk_popup = NULL; + discardPopup(); // so that it's recreated next time } diff --git a/workspace.cpp b/workspace.cpp index 7e1c2ee061..a71f92a901 100644 --- a/workspace.cpp +++ b/workspace.cpp @@ -459,7 +459,7 @@ Workspace::~Workspace() (*it)->release(); delete tab_box; delete popupinfo; - delete popup; + discardPopup(); XDeleteProperty(display(), rootWindow(), atoms->kwin_running); writeWindowRules(); diff --git a/workspace.h b/workspace.h index c289677c6f..3ec36cb795 100644 --- a/workspace.h +++ b/workspace.h @@ -496,6 +496,7 @@ class Workspace : public QObject, public KDecorationDefines void initShortcuts(); void readShortcuts(); void initDesktopPopup(); + void discardPopup(); void setupWindowShortcut( Client* c ); void checkCursorPos();