Match window role in Rules in a case insensitive manner
ClosedPublic

Authored by graesslin on Aug 25 2016, 11:33 AM.

Details

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

Diff Detail

Repository
R108 KWin
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
graesslin updated this revision to Diff 6264.Aug 25 2016, 11:33 AM
graesslin retitled this revision from to Match window role in Rules in a case insensitive manner.
graesslin updated this object.
graesslin edited the test plan for this revision. (Show Details)
graesslin added a reviewer: KWin.
Restricted Application added a project: KWin. · View Herald TranscriptAug 25 2016, 11:33 AM
Restricted Application added a subscriber: kwin. · View Herald Transcript

Alternatively, don't toLower when wriing the rule instead of lowercasing (utf-8) on each and every rule check?

Alternatively, don't toLower when wriing the rule instead of lowercasing (utf-8) on each and every rule check?

I cannot find a toLower when writing the rule - neither in rules.cpp nor in kcmkwin/kwinrules

kcmkwin/kwinrules/main.cpp:86
QByteArray role = info.windowRole().toLower();

The value is first used to compare against existing rules and afterwards (in case) to build a new one.

kcmkwin/kwinrules/main.cpp:86
QByteArray role = info.windowRole().toLower();

The value is first used to compare against existing rules and afterwards (in case) to build a new one.

ahhh. I only looked at the kcm code where that's not the case. So when going through systemsettings it's not going to be lowered, but when going through useractions menu, it's going to get lowered.

Interesting. So yes that would be a solution. Though it doesn't "fix" existing rules.

No, and they're not post-fixable at all (restore case)
Not sure why any case insensivity was added itfp, though (makes sense to ease hand-written rules, but that's not a regular task at all)
*shrug*

sebas added a subscriber: sebas.Sep 12 2016, 7:54 PM

I can't really comment on this solution as I can't judge the regression risk, I'd say shipit if you're comfortable with it, or abandon if not.

This revision was automatically updated to reflect the committed changes.