From aa804ee8c856e0fc4d788ac7db8e44980caeeea1 Mon Sep 17 00:00:00 2001 From: Chani Armitage Date: Mon, 8 Nov 2010 21:44:35 +0000 Subject: [PATCH] avoid dbus deadlocks use more consistent names too svn path=/trunk/KDE/kdebase/workspace/; revision=1194388 --- org.kde.KWin.xml | 4 ++-- sm.cpp | 12 +++++++++--- workspace.h | 5 +++-- 3 files changed, 14 insertions(+), 7 deletions(-) diff --git a/org.kde.KWin.xml b/org.kde.KWin.xml index 47ed80f91f..25afc0dcff 100644 --- a/org.kde.KWin.xml +++ b/org.kde.KWin.xml @@ -73,10 +73,10 @@ - + - + diff --git a/sm.cpp b/sm.cpp index eb87976b63..ad3b5e2321 100644 --- a/sm.cpp +++ b/sm.cpp @@ -204,9 +204,15 @@ void Workspace::storeSubSession(const QString &name, QSet sessionIds //cg.writeEntry( "desktop", currentDesktop()); } -void Workspace::storeActivity(const QString &id) +void Workspace::stopActivity(const QString &id) { - QStringList openActivities = openActivityList(); //FIXME please don't deadlock + //ugly hack to avoid dbus deadlocks + QMetaObject::invokeMethod(this, "reallyStopActivity", Qt::QueuedConnection, Q_ARG(QString, id)); + } + +void Workspace::reallyStopActivity(const QString &id) + { + QStringList openActivities = openActivityList(); QSet saveSessionIds; QSet dontCloseSessionIds; @@ -328,7 +334,7 @@ void Workspace::loadSubSessionInfo(const QString &name) addSessionInfo(cg); } -void Workspace::loadActivity(const QString &id) +void Workspace::startActivity(const QString &id) { if (!allActivities_.contains(id)) return; //bogus id diff --git a/workspace.h b/workspace.h index b44e35b76d..8a07fe9794 100644 --- a/workspace.h +++ b/workspace.h @@ -449,8 +449,8 @@ class Workspace : public QObject, public KDecorationDefines void toggleTiling(); void nextTileLayout(); void previousTileLayout(); - void storeActivity( const QString &id ); - void loadActivity( const QString &id ); + void stopActivity( const QString &id ); + void startActivity( const QString &id ); void setCurrentScreen( int new_screen ); @@ -769,6 +769,7 @@ class Workspace : public QObject, public KDecorationDefines void updateCurrentActivity(const QString &new_activity); void activityRemoved(const QString &activity); void activityAdded(const QString &activity); + void reallyStopActivity( const QString &id ); //dbus deadlocks suck protected: bool keyPressMouseEmulation( XKeyEvent& ev );