From a4397bbf0307aa14399dab3176f68fc7ef73e7be Mon Sep 17 00:00:00 2001 From: Vlad Zahorodnii Date: Mon, 22 Mar 2021 16:16:05 +0200 Subject: [PATCH] [Task Manager] React to activities changes A window can be moved to another activity externally, for example using the user actions menu in kwin. The window model should notify the task manager when such an event occurs. --- libtaskmanager/waylandtasksmodel.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/libtaskmanager/waylandtasksmodel.cpp b/libtaskmanager/waylandtasksmodel.cpp index c5cba3786..fd88e77f2 100644 --- a/libtaskmanager/waylandtasksmodel.cpp +++ b/libtaskmanager/waylandtasksmodel.cpp @@ -314,6 +314,14 @@ void WaylandTasksModel::Private::addWindow(KWayland::Client::PlasmaWindow *windo QObject::connect(window, &KWayland::Client::PlasmaWindow::applicationMenuChanged, q, [window, this] { this->dataChanged(window, QVector{ApplicationMenuServiceName, ApplicationMenuObjectPath}); }); + + QObject::connect(window, &KWayland::Client::PlasmaWindow::plasmaActivityEntered, q, [window, this] { + this->dataChanged(window, Activities); + }); + + QObject::connect(window, &KWayland::Client::PlasmaWindow::plasmaActivityLeft, q, [window, this] { + this->dataChanged(window, Activities); + }); } AppData WaylandTasksModel::Private::appData(KWayland::Client::PlasmaWindow *window)