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
This commit is contained in:
Martin Gräßlin 2016-08-25 13:30:25 +02:00
parent 2545162f87
commit 97b594501a
2 changed files with 2 additions and 3 deletions

View file

@ -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

View file

@ -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<uint>("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;