diff --git a/libs/kworkspace/ktaskmanager.cpp b/libs/kworkspace/ktaskmanager.cpp index 79051ec3..c8302b7b 100644 --- a/libs/kworkspace/ktaskmanager.cpp +++ b/libs/kworkspace/ktaskmanager.cpp @@ -121,7 +121,7 @@ KTaskAction::KTaskAction(const WId window, const KActionType type, m_window(window) { switch (type) { - // unlike the kwin decoration menu the minimize action is checked based on the window task + // unlike the kwin decoration menu the minimize action is checked based on the window state // just like maximize is case KTaskAction::ActionMinimize: { connect(this, SIGNAL(triggered()), this, SLOT(slotMinimize())); diff --git a/plasma/applets/tasks/tasks.cpp b/plasma/applets/tasks/tasks.cpp index f3316e02..36e51cbd 100644 --- a/plasma/applets/tasks/tasks.cpp +++ b/plasma/applets/tasks/tasks.cpp @@ -229,6 +229,10 @@ void TasksApplet::init() KTaskManager::self(), SIGNAL(taskRemoved(KTaskManager::Task)), this, SLOT(slotUpdateLayout()) ); + connect( + KWindowSystem::self(), SIGNAL(currentDesktopChanged(int)), + this, SLOT(slotUpdateLayout()) + ); } void TasksApplet::constraintsEvent(Plasma::Constraints constraints) @@ -274,6 +278,9 @@ void TasksApplet::slotUpdateLayout() } adjustSize(); foreach (const KTaskManager::Task &task, KTaskManager::self()->tasks()) { + if (task.desktop != KWindowSystem::currentDesktop()) { + continue; + } TasksSvg* taskssvg = new TasksSvg(task, this); taskssvg->setOrientation(m_layout->orientation()); m_layout->addItem(taskssvg);