From 085abe58b2fb35e52d99132ffaa86795630d87b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lubo=C5=A1=20Lu=C5=88=C3=A1k?= Date: Thu, 7 Aug 2008 11:51:20 +0000 Subject: [PATCH] Don't lose the desktop submenu in Alt+F3. svn path=/trunk/KDE/kdebase/workspace/; revision=843596 --- composite.cpp | 6 ++---- useractions.cpp | 12 ++++++++---- workspace.cpp | 2 +- workspace.h | 1 + 4 files changed, 12 insertions(+), 9 deletions(-) diff --git a/composite.cpp b/composite.cpp index b45a0deb09..9b65411ea9 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 a1b58a8d43..31cdd1a55e 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 68703542a1..c910fc774e 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();