diff --git a/shell_client.h b/shell_client.h --- a/shell_client.h +++ b/shell_client.h @@ -46,6 +46,8 @@ ShellClient(KWayland::Server::XdgShellPopupInterface *surface); virtual ~ShellClient(); + bool eventFilter(QObject *watched, QEvent *event) override; + QStringList activities() const override; QPoint clientContentPos() const override; QSize clientSize() const override; diff --git a/shell_client.cpp b/shell_client.cpp --- a/shell_client.cpp +++ b/shell_client.cpp @@ -50,6 +50,8 @@ using namespace KWayland::Server; +static const QByteArray s_schemePropertyName = QByteArrayLiteral("KDE_COLOR_SCHEME_PATH"); + namespace KWin { @@ -1137,6 +1139,18 @@ connect(m_qtExtendedSurface.data(), &QtExtendedSurfaceInterface::lowerRequested, this, [this]() { workspace()->lowerClientRequest(this); }); + m_qtExtendedSurface->installEventFilter(this); +} + +bool ShellClient::eventFilter(QObject *watched, QEvent *event) +{ + if (watched == m_qtExtendedSurface.data() && event->type() == QEvent::DynamicPropertyChange) { + QDynamicPropertyChangeEvent *pe = static_cast(event); + if (pe->propertyName() == s_schemePropertyName) { + updateColorScheme(rules()->checkDecoColor(m_qtExtendedSurface->property(pe->propertyName().constData()).toString())); + } + } + return false; } bool ShellClient::hasStrut() const