react to activity removal
svn path=/trunk/KDE/kdebase/workspace/; revision=1126057
This commit is contained in:
parent
30313d2869
commit
59590a5993
3 changed files with 20 additions and 5 deletions
|
@ -1495,14 +1495,15 @@ void Client::setOnActivity( const QString &activity, bool enable )
|
|||
{
|
||||
if( activityList.contains(activity) == enable ) //nothing to do
|
||||
return;
|
||||
KActivityConsumer c;
|
||||
QStringList allActivities = c.availableActivities();
|
||||
if( !allActivities.contains(activity) ) //bogus ID
|
||||
return;
|
||||
//check whether we should set it to all activities
|
||||
QStringList newActivitiesList = activityList;
|
||||
QStringList allActivities = KActivityConsumer().availableActivities();
|
||||
if (enable)
|
||||
{
|
||||
if( !allActivities.contains(activity) ) //bogus ID
|
||||
return;
|
||||
newActivitiesList.append(activity);
|
||||
}
|
||||
else
|
||||
newActivitiesList.removeOne(activity);
|
||||
if( newActivitiesList.size() == allActivities.size() || newActivitiesList.isEmpty() )
|
||||
|
|
|
@ -243,6 +243,7 @@ Workspace::Workspace( bool restore )
|
|||
connect( Kephal::Screens::self(), SIGNAL( screenMoved(Kephal::Screen*, QPoint, QPoint) ), SLOT( desktopResized() ));
|
||||
|
||||
connect( &activityController_, SIGNAL( currentActivityChanged(QString) ), SLOT( updateCurrentActivity(QString) ));
|
||||
connect( &activityController_, SIGNAL( activityRemoved(QString) ), SLOT( activityRemoved(QString) ));
|
||||
}
|
||||
|
||||
void Workspace::init()
|
||||
|
@ -1647,6 +1648,18 @@ void Workspace::updateCurrentActivity(const QString &new_activity)
|
|||
|
||||
}
|
||||
|
||||
/**
|
||||
* updates clients when an activity is destroyed.
|
||||
* this ensures that a client does not get 'lost' if the only activity it's on is removed.
|
||||
*/
|
||||
void Workspace::activityRemoved(const QString &activity)
|
||||
{
|
||||
foreach (Client *client, stacking_order)
|
||||
{
|
||||
client->setOnActivity(activity, false);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Called only from D-Bus
|
||||
*/
|
||||
|
|
|
@ -756,7 +756,8 @@ class Workspace : public QObject, public KDecorationDefines
|
|||
void resetCursorPosTime();
|
||||
void delayedCheckUnredirect();
|
||||
|
||||
void updateCurrentActivity(const QString &activity);
|
||||
void updateCurrentActivity(const QString &new_activity);
|
||||
void activityRemoved(const QString &activity);
|
||||
|
||||
protected:
|
||||
bool keyPressMouseEmulation( XKeyEvent& ev );
|
||||
|
|
Loading…
Reference in a new issue