diff --git a/abstract_client.cpp b/abstract_client.cpp
index 6bf34fcbe5..c9378af543 100644
--- a/abstract_client.cpp
+++ b/abstract_client.cpp
@@ -1051,4 +1051,8 @@ void AbstractClient::updateGeometryBeforeUpdateBlocking()
m_geometryBeforeUpdateBlocking = geom;
}
+void AbstractClient::updateTabGroupStates(TabGroup::States)
+{
+}
+
}
diff --git a/abstract_client.h b/abstract_client.h
index f57a835eaa..9fb6a3c0f4 100644
--- a/abstract_client.h
+++ b/abstract_client.h
@@ -23,6 +23,7 @@ along with this program. If not, see .
#include "toplevel.h"
#include "options.h"
#include "rules.h"
+#include "tabgroup.h"
#include
@@ -37,8 +38,6 @@ class PlasmaWindowInterface;
namespace KWin
{
-class TabGroup;
-
namespace TabBox
{
class TabBoxClientImpl;
@@ -588,6 +587,13 @@ protected:
**/
void addRepaintDuringGeometryUpdates();
+ /**
+ * Convenient method to update the TabGroup states if there is one present.
+ * Marked as virtual as TabGroup does not yet handle AbstractClient, but only
+ * subclasses of AbstractClient. Given that the default implementation does nothing.
+ **/
+ virtual void updateTabGroupStates(TabGroup::States states);
+
private:
void handlePaletteChange();
QSharedPointer m_tabBoxClient;
diff --git a/client.cpp b/client.cpp
index d77631965b..7415001b2a 100644
--- a/client.cpp
+++ b/client.cpp
@@ -2295,6 +2295,13 @@ void Client::processDecorationMove()
}
}
+void Client::updateTabGroupStates(TabGroup::States states)
+{
+ if (auto t = tabGroup()) {
+ t->updateStates(this, states);
+ }
+}
+
} // namespace
#include "client.moc"
diff --git a/client.h b/client.h
index 604ceb4d07..2dfb968d97 100644
--- a/client.h
+++ b/client.h
@@ -487,6 +487,7 @@ protected:
bool belongsToDesktop() const override;
bool isActiveFullScreen() const override;
void setGeometryRestore(const QRect &geo) override;
+ void updateTabGroupStates(TabGroup::States states) override;
private Q_SLOTS:
void delayedSetShortcut();
diff --git a/geometry.cpp b/geometry.cpp
index bd90583c78..7908b836a4 100644
--- a/geometry.cpp
+++ b/geometry.cpp
@@ -2078,8 +2078,7 @@ void Client::move(int x, int y, ForceGeometry_t force)
updateGeometryBeforeUpdateBlocking();
// Update states of all other windows in this group
- if (tabGroup())
- tabGroup()->updateStates(this, TabGroup::Geometry);
+ updateTabGroupStates(TabGroup::Geometry);
emit geometryChanged();
}