From 9e97c7383c73bbcfdfde25bf36ca012a27244ebe Mon Sep 17 00:00:00 2001 From: Vlad Zahorodnii Date: Thu, 17 Nov 2022 20:57:00 +0200 Subject: [PATCH] Add support for DecoratedClient::windowClass() --- src/decorations/decoratedclient.cpp | 5 +++++ src/decorations/decoratedclient.h | 1 + .../kwindecoration/declarative-plugin/previewclient.cpp | 5 +++++ .../kwindecoration/declarative-plugin/previewclient.h | 1 + 4 files changed, 12 insertions(+) diff --git a/src/decorations/decoratedclient.cpp b/src/decorations/decoratedclient.cpp index 34650f125a..e64f51bac8 100644 --- a/src/decorations/decoratedclient.cpp +++ b/src/decorations/decoratedclient.cpp @@ -291,5 +291,10 @@ bool DecoratedClientImpl::isApplicationMenuActive() const return m_window->applicationMenuActive(); } +QString DecoratedClientImpl::windowClass() const +{ + return m_window->resourceName() + QLatin1Char(' ') + m_window->resourceClass(); +} + } } diff --git a/src/decorations/decoratedclient.h b/src/decorations/decoratedclient.h index 2c1a06011a..08bd9c5c3b 100644 --- a/src/decorations/decoratedclient.h +++ b/src/decorations/decoratedclient.h @@ -55,6 +55,7 @@ public: bool providesContextHelp() const override; QSize size() const override; int width() const override; + QString windowClass() const override; WId windowId() const override; Qt::Edges adjacentScreenEdges() const override; diff --git a/src/kcmkwin/kwindecoration/declarative-plugin/previewclient.cpp b/src/kcmkwin/kwindecoration/declarative-plugin/previewclient.cpp index ab73da9593..53db4e3301 100644 --- a/src/kcmkwin/kwindecoration/declarative-plugin/previewclient.cpp +++ b/src/kcmkwin/kwindecoration/declarative-plugin/previewclient.cpp @@ -271,6 +271,11 @@ Qt::Edges PreviewClient::adjacentScreenEdges() const return edges; } +QString PreviewClient::windowClass() const +{ + return QString(); +} + bool PreviewClient::hasApplicationMenu() const { return true; diff --git a/src/kcmkwin/kwindecoration/declarative-plugin/previewclient.h b/src/kcmkwin/kwindecoration/declarative-plugin/previewclient.h index 5ffca89e3b..b5ff711b51 100644 --- a/src/kcmkwin/kwindecoration/declarative-plugin/previewclient.h +++ b/src/kcmkwin/kwindecoration/declarative-plugin/previewclient.h @@ -80,6 +80,7 @@ public: QPalette palette() const override; QColor color(ColorGroup group, ColorRole role) const override; Qt::Edges adjacentScreenEdges() const override; + QString windowClass() const override; bool hasApplicationMenu() const override; bool isApplicationMenuActive() const override;