diff --git a/effects/dimscreen/dimscreen.cpp b/effects/dimscreen/dimscreen.cpp
index 3b6147c1bb..a7f4f7e4d7 100644
--- a/effects/dimscreen/dimscreen.cpp
+++ b/effects/dimscreen/dimscreen.cpp
@@ -21,9 +21,19 @@ along with this program. If not, see .
#include
+#include
+
namespace KWin
{
+static const QSet 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"),
+};
+
DimScreenEffect::DimScreenEffect()
: 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;