Commit 7550d2a0 authored by Vlad Zahorodnii's avatar Vlad Zahorodnii
Browse files

[effects/dimscreen] Use QSet for checking whether activated window asks for permissions

Do not construct QStringList with classes of windows that ask for
permissions. Instead, create a static set of those window classes (to
avoid the unnecessary construction of QStringList and make lookups

Reviewers: #kwin, davidedmundson

Reviewed By: #kwin, davidedmundson

Subscribers: kwin

Tags: #kwin

Differential Revision:
parent d50f2803
......@@ -21,9 +21,19 @@ along with this program. If not, see <>.
#include <kwinglutils.h>
#include <QSet>
namespace KWin
static const QSet<QString> s_authWindows {
QStringLiteral("kdesu kdesu"),
QStringLiteral("kdesudo kdesudo"),
QStringLiteral("pinentry pinentry"),
QStringLiteral("polkit-kde-authentication-agent-1 polkit-kde-authentication-agent-1"),
QStringLiteral("polkit-kde-manager polkit-kde-manager"),
: mActivated(false)
, activateAnimation(false)
......@@ -86,13 +96,7 @@ void DimScreenEffect::paintWindow(EffectWindow *w, int mask, QRegion region, Win
void DimScreenEffect::slotWindowActivated(EffectWindow *w)
if (!w) return;
QStringList check;
check << QStringLiteral("kdesu kdesu");
check << QStringLiteral("kdesudo kdesudo");
check << QStringLiteral("polkit-kde-manager polkit-kde-manager");
check << QStringLiteral("polkit-kde-authentication-agent-1 polkit-kde-authentication-agent-1");
check << QStringLiteral("pinentry pinentry");
if (check.contains(w->windowClass())) {
if (s_authWindows.contains(w->windowClass())) {
mActivated = true;
activateAnimation = true;
deactivateAnimation = false;
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment