From 1d0e75bc5ceb8144b30386e549608b7d7b89190e Mon Sep 17 00:00:00 2001 From: Fushan Wen Date: Thu, 16 Dec 2021 12:13:06 +0800 Subject: [PATCH] x11client: Replace activityList with m_activityList KWin does not update activity status when setting `_KDE_NET_WM_ACTIVITIES` to nullUuid outside of KWin, which causes "All Activities" not working as expected for KWindowSystem. `X11Client::activityList` is not kept in sync with `AbstractClient::m_activityList`. Move `m_activityList` from private to protected, and use it in `X11Client::readActivities` BUG: 440496 --- src/abstract_client.h | 3 ++- src/x11client.cpp | 10 +++++----- src/x11client.h | 1 - 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/abstract_client.h b/src/abstract_client.h index 5645cc26e8..4ca5f50b4a 100644 --- a/src/abstract_client.h +++ b/src/abstract_client.h @@ -1238,6 +1238,8 @@ protected: void cleanTabBox(); + QStringList m_activityList; + private Q_SLOTS: void shadeHover(); void shadeUnhover(); @@ -1265,7 +1267,6 @@ private: ShadeMode m_shadeMode = ShadeNone; QVector m_desktops; - QStringList m_activityList; int m_activityUpdatesBlocked = 0; bool m_blockedActivityUpdatesRequireTransients = false; diff --git a/src/x11client.cpp b/src/x11client.cpp index e71139b8df..a75a94cb8e 100644 --- a/src/x11client.cpp +++ b/src/x11client.cpp @@ -2409,16 +2409,16 @@ void X11Client::readActivities(Xcb::StringProperty &property) if (prop == Activities::nullUuid()) { //copied from setOnAllActivities to avoid a redundant XChangeProperty. - if (!activityList.isEmpty()) { - activityList.clear(); + if (!m_activityList.isEmpty()) { + m_activityList.clear(); updateActivities(true); } return; } if (prop.isEmpty()) { //note: this makes it *act* like it's on all activities but doesn't set the property to 'ALL' - if (!activityList.isEmpty()) { - activityList.clear(); + if (!m_activityList.isEmpty()) { + m_activityList.clear(); updateActivities(true); } return; @@ -2426,7 +2426,7 @@ void X11Client::readActivities(Xcb::StringProperty &property) newActivitiesList = prop.split(u','); - if (newActivitiesList == activityList) + if (newActivitiesList == m_activityList) return; //expected change, it's ok. //otherwise, somebody else changed it. we need to validate before reacting. diff --git a/src/x11client.h b/src/x11client.h index a53d9a312e..babbe2050f 100644 --- a/src/x11client.h +++ b/src/x11client.h @@ -448,7 +448,6 @@ private: Xcb::Window m_client; Xcb::Window m_wrapper; Xcb::Window m_frame; - QStringList activityList; int m_activityUpdatesBlocked; bool m_blockedActivityUpdatesRequireTransients; Xcb::Window m_moveResizeGrabWindow;