kdecoration: Port to DecoratedClient::windowClass()

It removes the need for X11 and makes window class matching work on
wayland.
wilder-reb-27
Vlad Zahorodnii 3 years ago
parent eb97f1ded1
commit b4657e5e7c
  1. 14
      kdecoration/breezesettingsprovider.cpp

@ -8,8 +8,6 @@
#include "breezeexceptionlist.h"
#include <KWindowInfo>
#include <QRegularExpression>
#include <QTextStream>
@ -60,7 +58,7 @@ void SettingsProvider::reconfigure()
InternalSettingsPtr SettingsProvider::internalSettings(Decoration *decoration) const
{
QString windowTitle;
QString className;
QString windowClass;
// get the client
const auto client = decoration->client().toStrongRef();
@ -87,15 +85,7 @@ InternalSettingsPtr SettingsProvider::internalSettings(Decoration *decoration) c
default:
case InternalSettings::ExceptionWindowClassName: {
if (className.isEmpty()) {
// retrieve class name
KWindowInfo info(client->windowId(), {}, NET::WM2WindowClass);
QString window_className(QString::fromUtf8(info.windowClassName()));
QString window_class(QString::fromUtf8(info.windowClassClass()));
className = window_className + QStringLiteral(" ") + window_class;
}
value = className;
value = windowClass.isEmpty() ? (windowClass = client->windowClass()) : windowClass;
break;
}
}

Loading…
Cancel
Save