diff --git a/containmentactions/switchwindow/switch.h b/containmentactions/switchwindow/switch.h --- a/containmentactions/switchwindow/switch.h +++ b/containmentactions/switchwindow/switch.h @@ -23,7 +23,8 @@ #include "ui_config.h" #include -// liblegacytaskmanager +// libtaskmanager +#include #include class QAction; @@ -66,6 +67,7 @@ }; QList m_actions; + TaskManager::ActivityInfo *m_activityInfo; TaskManager::TasksModel *m_tasksModel; Ui::Config m_ui; MenuMode m_mode; diff --git a/containmentactions/switchwindow/switch.cpp b/containmentactions/switchwindow/switch.cpp --- a/containmentactions/switchwindow/switch.cpp +++ b/containmentactions/switchwindow/switch.cpp @@ -34,11 +34,17 @@ SwitchWindow::SwitchWindow(QObject *parent, const QVariantList &args) : Plasma::ContainmentActions(parent, args), + m_activityInfo(new TaskManager::ActivityInfo(this)), m_tasksModel(new TaskManager::TasksModel(this)), m_mode(AllFlat), m_clearOrderTimer(0) { m_tasksModel->setGroupMode(TaskManager::TasksModel::GroupDisabled); + + m_tasksModel->setActivity(m_activityInfo->currentActivity()); + m_tasksModel->setFilterByActivity(true); + connect(m_activityInfo, &TaskManager::ActivityInfo::currentActivityChanged, + this, [this]() { m_tasksModel->setActivity(m_activityInfo->currentActivity()); }); } SwitchWindow::~SwitchWindow() diff --git a/libtaskmanager/xwindowtasksmodel.cpp b/libtaskmanager/xwindowtasksmodel.cpp --- a/libtaskmanager/xwindowtasksmodel.cpp +++ b/libtaskmanager/xwindowtasksmodel.cpp @@ -37,6 +37,7 @@ #include #include +#include #include #include #include @@ -213,6 +214,8 @@ NET::OverrideMask | NET::TopMenuMask | NET::UtilityMask | NET::SplashMask); + qDebug() << info.visibleName() << info->hasState(NET::SkipTaskbar); + const WId leader = info.transientFor(); // Handle transient.