plasma: show only the tasks of the current virtual desktop from tasks applet

could be made an option but do I care?

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
Ivailo Monev 2023-09-29 04:39:31 +03:00
parent a4a32d63ec
commit 1aca9ade6a
2 changed files with 8 additions and 1 deletions

View file

@ -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()));

View file

@ -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);