From 1fe8a18844c55db506377ab9b01e76fc89742553 Mon Sep 17 00:00:00 2001 From: Vlad Zahorodnii Date: Tue, 9 Nov 2021 12:51:30 +0200 Subject: [PATCH] Make Scene responsible for scheduling repaint when current activity changes --- src/scene.cpp | 1 + src/workspace.cpp | 7 +------ src/workspace.h | 1 + 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/src/scene.cpp b/src/scene.cpp index d55b3612d2..63df70f7b2 100644 --- a/src/scene.cpp +++ b/src/scene.cpp @@ -99,6 +99,7 @@ void Scene::initialize() connect(kwinApp()->platform(), &Platform::outputDisabled, this, &Scene::removeRepaints); connect(workspace(), &Workspace::geometryChanged, this, &Scene::addRepaintFull); + connect(workspace(), &Workspace::currentActivityChanged, this, &Scene::addRepaintFull); connect(workspace(), &Workspace::currentDesktopChanged, this, &Scene::addRepaintFull); connect(workspace(), &Workspace::stackingOrderChanged, this, &Scene::addRepaintFull); } diff --git a/src/workspace.cpp b/src/workspace.cpp index 9e54d1fa0d..a2f8d27c1d 100644 --- a/src/workspace.cpp +++ b/src/workspace.cpp @@ -1186,12 +1186,7 @@ void Workspace::updateCurrentActivity(const QString &new_activity) else focusToNull(); - // Not for the very first time, only if something changed and there are more than 1 desktops - - //if ( effects != NULL && old_desktop != 0 && old_desktop != new_desktop ) - // static_cast( effects )->desktopChanged( old_desktop ); - if (Compositor::compositing() && m_compositor) - m_compositor->scene()->addRepaintFull(); + Q_EMIT currentActivityChanged(); #else Q_UNUSED(new_activity) #endif diff --git a/src/workspace.h b/src/workspace.h index 2b8f59fbdf..9cd496c32f 100644 --- a/src/workspace.h +++ b/src/workspace.h @@ -507,6 +507,7 @@ Q_SIGNALS: //Signals required for the scripting interface void desktopPresenceChanged(KWin::AbstractClient*, int); + void currentActivityChanged(); void currentDesktopChanged(int, KWin::AbstractClient*); void clientAdded(KWin::AbstractClient *); void clientRemoved(KWin::AbstractClient*);