Commit 97b59450 authored by Martin Flöser's avatar Martin Flöser

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
4f7edb8d 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
parent 2545162f
......@@ -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
......
......@@ -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;
......
Markdown is supported
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