From d6e119f49eaedbd1d6e2e2364fd51ecb5c4fd261 Mon Sep 17 00:00:00 2001 From: Aleix Pol Date: Thu, 14 May 2020 17:03:02 +0200 Subject: [PATCH] wayland_server: Improve debug message, reduce duplicates Summary: Demote the "interface not granted" message from a warning to debug and improve the wording a bit. We are listing all the interfaces, it's not like we're not granting an interface that the application wants, it's that we're not offering an interface to an application because it didn't opt in. Only report every miss once, to reduce the noise. Test Plan: ran kwin Reviewers: #kwin, davidedmundson Reviewed By: #kwin, davidedmundson Subscribers: kwin Tags: #kwin Differential Revision: https://phabricator.kde.org/D29759 --- wayland_server.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/wayland_server.cpp b/wayland_server.cpp index ca35c82e6e..66f8d74993 100644 --- a/wayland_server.cpp +++ b/wayland_server.cpp @@ -234,7 +234,8 @@ public: return interfaces; } - QSet interfacesBlackList = {"org_kde_kwin_remote_access_manager", "org_kde_plasma_window_management", "org_kde_kwin_fake_input", "org_kde_kwin_keystate"}; + const QSet interfacesBlackList = {"org_kde_kwin_remote_access_manager", "org_kde_plasma_window_management", "org_kde_kwin_fake_input", "org_kde_kwin_keystate"}; + QSet m_reported; bool allowInterface(KWaylandServer::ClientConnection *client, const QByteArray &interfaceName) override { if (client->processId() == getpid()) { @@ -257,7 +258,13 @@ public: client->setProperty("requestedInterfaces", requestedInterfaces); } if (!requestedInterfaces.toStringList().contains(QString::fromUtf8(interfaceName))) { - qCWarning(KWIN_CORE) << "Did not grant the interface" << interfaceName << "to" << client->executablePath() << ". Please request it under X-KDE-Wayland-Interfaces"; + if (KWIN_CORE().isDebugEnabled()) { + const QString id = client->executablePath() + QLatin1Char('|') + QString::fromUtf8(interfaceName); + if (!m_reported.contains({id})) { + m_reported.insert(id); + qCDebug(KWIN_CORE) << "Interface" << interfaceName << "not in X-KDE-Wayland-Interfaces of" << client->executablePath(); + } + } return false; } }