SUMMARY kwin rules not saved upon reboot. STEPS TO REPRODUCE 1. Start with empty rules section in settings. (also .config/kwinrulesrc is empty) 2. Import the following rule: ``` [Disable composoting for slippi] Description=Disable composoting for slippi blockcompositing=true blockcompositingrule=6 title=Dolphin titlematch=1 wmclass=apprun wmclassmatch=1 ``` 3. Hit apply. 4. Reboot. OBSERVED RESULT The rule gone in the settings app (but present in .config/kwinrulesrc). The rule does not trigger. EXPECTED RESULT The rule triggers and shows up in the settings app. SOFTWARE/OS VERSIONS Linux/KDE Plasma: 5.23 KDE Plasma Version: 5.23.3 KDE Frameworks Version: 5.88.0 Qt Version: 5.15.3 ADDITIONAL INFORMATION The rule is active and is listed as expected before reboot. kwinrulesrc at that points contains the rule as well as: ```[General] rules=3e2338cb-3ebc-47eb-8e6e-6fdcef00f79f```
It seems you set the rule to "Force temporarily" (blockcompositingrule=6) By design this setting forces the rule while the window is active and then deletes it, since it's a temporary setting If you'd like to have it permanently please set it to "Force" instead. There's a bug though, and it's that it keeps it on the kwinrulesrc file.
(In reply to Ismael Asensio from comment #1) > It seems you set the rule to "Force temporarily" (blockcompositingrule=6) > > By design this setting forces the rule while the window is active and then > deletes it, since it's a temporary setting > If you'd like to have it permanently please set it to "Force" instead. > > There's a bug though, and it's that it keeps it on the kwinrulesrc file. I completely misunderstood what "temporarily" indicates in that case. Sorry for the report.
(In reply to r1ntse.a from comment #2) > (In reply to Ismael Asensio from comment #1) > > It seems you set the rule to "Force temporarily" (blockcompositingrule=6) > > > > By design this setting forces the rule while the window is active and then > > deletes it, since it's a temporary setting > > If you'd like to have it permanently please set it to "Force" instead. > > > > There's a bug though, and it's that it keeps it on the kwinrulesrc file. > > I completely misunderstood what "temporarily" indicates in that case. Sorry > for the report. Don't be. It was a very good and thorough report, with all the information required to figure it out. And it exposed something that it isn't working right, so thanks a lot for your time on it! If you don't mind, I'll change the title of the bug to track that temporary rules are not deleted from the config file.
Can confirm this in Plasma 5.24. Rules with "apply now" are not deleted from config file and not displayed in "Windows rules"
https://invent.kde.org/plasma/kwin/-/merge_requests/5719
Git commit d2d92cdfd2c1869942cf119b2b8f680750fa7e96 by Ismael Asensio. Committed on 13/05/2024 at 18:18. Pushed by iasensio into branch 'master'. rules/RuleBook: Optimize saving discarded rules to config After porting to KConfigXT settings some time ago, there was still an inefficient and error-prone codepath between the `RuleBook` (which keeps the runtime list of `Rules`) and the `RuleBookSettings` (responsible for config reads and saves), in the form of the `setRules()` method. We can eliminate the `setRules()` codepath, reducing unnecessary runtime process and file access operations, and instead: - Keep track of the config `id` in the `Rules` objects - Keep a single `RuleBookSettings` object as a member - Modify or delete the discarded rules settings directly - Save when necessary This also fixes two bugs/pitfalls of the previous solution: - the config group id for each rule is now preserved instead of creating new ones - no leftovers on the config file for the discarded groups and entries Setting custom configs for the integration tests still works unchanged. FIXED-IN: 6.1 M +12 -44 src/rulebooksettings.cpp M +2 -4 src/rulebooksettings.h M +29 -13 src/rules.cpp M +6 -6 src/rules.h https://invent.kde.org/plasma/kwin/-/commit/d2d92cdfd2c1869942cf119b2b8f680750fa7e96