Bug 423138 - [kcm/kwinrules X11] Theme rules are not applied
Summary: [kcm/kwinrules X11] Theme rules are not applied
Status: RESOLVED FIXED
Alias: None
Product: kwin
Classification: Plasma
Component: rules (show other bugs)
Version: unspecified
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Ismael Asensio
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-06-18 07:54 UTC by Riccardo Robecchi
Modified: 2020-06-24 19:21 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In: 5.19.3
Sentry Crash Report:


Attachments
Screenshot of settings app (41.63 KB, image/png)
2020-06-18 07:54 UTC, Riccardo Robecchi
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Riccardo Robecchi 2020-06-18 07:54:26 UTC
Created attachment 129465 [details]
Screenshot of settings app

SUMMARY
Setting theming rules for specific windows has no effect.

STEPS TO REPRODUCE
1. open the settings and create new rule
2. detect window
3. apply theming and select a theme different from the one in use

OBSERVED RESULT
The new theme is not applied. This is especially evident if selecting a dark theme when the one in use is light and vice-versa. In the attached screenshot you can see that the titlebar remains dark despite Arc being a light theme.

EXPECTED RESULT
The new theme is applied.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: KDE neon
KDE Plasma Version: 5.19.1
KDE Frameworks Version: 5.71
Qt Version: 5.14.2
Comment 1 Ismael Asensio 2020-06-18 23:06:40 UTC
This is a bug in the detection of the window properties.
The "window class" in this case should be "systemsettings" and not "systemsetting5".

There is a MR to fix that:
https://invent.kde.org/plasma/kwin/-/merge_requests/65

Thanks for the report.
Comment 2 Riccardo Robecchi 2020-06-19 14:27:20 UTC
You are right! The same issue was present with Firefox, whose window were identified as being "navigator" class, so I made an experiment and found out this is actually solved when using "navigator firefox". Thank you!
Comment 3 Ismael Asensio 2020-06-24 19:21:24 UTC
Git commit 3bfc750a79f967a93612385def636dced1ed1337 by Ismael Asensio.
Committed on 24/06/2020 at 18:13.
Pushed by iasensio into branch 'Plasma/5.19'.

[kcm/kwinrules] Fix detection of wmclass property

Property `wmclass` of a window rule works in a special way, as it can have
two meanings depending on `wmclasscomplete` flag:
- false: only matches `resourceClass`
- true: matches `resourceName` and `resourceClass`

This MR fixes two subtle bugs when detecting the properties of a window:

In the first case, `resourceName` was being wrongly set instead, which
prevented window matching for windows where those two values differ.

Also, the `wmclass` field was always set to `resourceName` independently
of `wmclasscomplete` property.
FIXED-IN: 5.19.3

M  +7    -6    kcmkwin/kwinrules/rulesmodel.cpp

https://invent.kde.org/plasma/kwin/commit/3bfc750a79f967a93612385def636dced1ed1337