From 97b594501a439f4e5ee5f4237f253fb84087c423 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Gr=C3=A4=C3=9Flin?= Date: Thu, 25 Aug 2016 13:30:25 +0200 Subject: [PATCH] Match window role in Rules in a case insensitive manner Summary: We used to have a toLower when reading the rule. This was removed with 4f7edb8 which turned it into a case sensitive matching to fix a regression. But this created another regression: existing rules written lower case are no longer matched. This change makes the role matching case insensitive again. BUG: 367554 Reviewers: #kwin Subscribers: kwin Tags: #kwin Differential Revision: https://phabricator.kde.org/D2574 --- autotests/integration/window_rules_test.cpp | 1 - rules.cpp | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/autotests/integration/window_rules_test.cpp b/autotests/integration/window_rules_test.cpp index e38c384e19..20baa15eb2 100644 --- a/autotests/integration/window_rules_test.cpp +++ b/autotests/integration/window_rules_test.cpp @@ -154,7 +154,6 @@ void WindowRuleTest::testApplyInitialMaximizeVert() QVERIFY(surfaceChangedSpy.isValid()); QVERIFY(surfaceChangedSpy.wait()); QVERIFY(client->surface()); - QEXPECT_FAIL("CamelCase", "BUG 367554", Continue); QCOMPARE(client->maximizeMode(), MaximizeVertical); // destroy window again diff --git a/rules.cpp b/rules.cpp index 93fcd1ad06..3a6707cc1b 100644 --- a/rules.cpp +++ b/rules.cpp @@ -141,7 +141,7 @@ void Rules::readFromCfg(const KConfigGroup& cfg) description = cfg.readEntry("description"); READ_MATCH_STRING(wmclass, .toLower().toLatin1()); wmclasscomplete = cfg.readEntry("wmclasscomplete" , false); - READ_MATCH_STRING(windowrole, .toLatin1()); + READ_MATCH_STRING(windowrole, .toLower().toLatin1()); READ_MATCH_STRING(title,); READ_MATCH_STRING(clientmachine, .toLower().toLatin1()); types = NET::WindowTypeMask(cfg.readEntry("types", NET::AllTypesMask)); @@ -451,7 +451,7 @@ bool Rules::match(const Client* c) const return false; if (!matchWMClass(c->resourceClass(), c->resourceName())) return false; - if (!matchRole(c->windowRole())) + if (!matchRole(c->windowRole().toLower())) return false; if (!matchClientMachine(c->clientMachine()->hostName(), c->clientMachine()->isLocal())) return false;