SUMMARY I have some kwin Window Rules, basically for certain firefox windows, if the title of the window matches a string it will force the size and position so that it always appears on the screen where I want. This part works perfectly. The problem is that it seems to forget the rules. The rules will be working perfectly, then suddenly it stops working. When I go back to the settings window, some of the rules will ramdomly be gone, different ones every time. The issue seems to be that it can't save all the rules properly, they keep getting deleted. STEPS TO REPRODUCE 1. Make several Window Rules from System Settings-> Window Mnagement->window rules. 2. Wait a bit and they will dissapear and the rules stop working. OBSERVED RESULT Windows not getting their positions and size set based on the rules, works initially, then suddenly stops working. EXPECTED RESULT Windows should continue to have their size and position set based on the rules SOFTWARE/OS VERSIONS Operating System: Kubuntu 18.10 KDE Plasma Version: 5.14.4 Qt Version: 5.11.1 KDE Frameworks Version: 5.52.0 Kernel Version: 4.18.0-11-generic OS Type: 64-bit Processors: 8 × AMD Ryzen 5 2400G with Radeon Vega Graphics Memory: 14.7 GiB of RAM ADDITIONAL INFORMATION My ~/.config/ foler has the following: -rw------- 1 xx xx 1502 Dec 3 15:05 kwinrc -rw------- 1 xx xx 1007 Dec 7 16:35 kwinrulesrc where xx is my username. Sometime the kwinrulesrc file will have a few rules rndomly missing. I even tried to chmod 000 the file after importing all my rules again to make sure it can't be modified by another file, and the problem persisted, the rules were still in the file but the windows were not being positioned correctly. Of course now I can't use the gui to 'refresh' the rules so I had to change the permissions back and I now keep using the above workaround to refresh the rules. Work around At first, I would leave the settings window open in another activity and then just press 'move up' and 'move down' to force and change, hit apply and it will keep working as normal. Sometimes this stops working just 1-2 mins later so I have exported all my rules so that I can reimport them quickly.
please attach both a working and a broken kwinrulesrc
Created attachment 116970 [details] Kwin Window Rules Files These are all the rules I am using, I import them into the Window Rules via the GUI. All of the rules work, initially, after a time some of the rules stop working. If I reimport the rules, they start working again. Which ones stop working seems to be random.
Created attachment 116971 [details] This is the kwinrulesrc file when the rules are no longer working Notice the [Oscar - Main] rule is no longer present and it is not working.
The rules in the first attachment look slightly wrong to me. The groups should be [1] and there should be a General section. In the second file what strikes me as odd is XftSubPixel[$d] and similar. These should not be there and I don't know how they get in there.
I just tried erasing the kwinrulesrc file, then reimporting just my rules from the first file. The [general[ and [kde] part got added in again, same as before. Also within a few minutes the [Oscar -Labs] rules was releted from the kwinrulesrc file and stopped working. Re-importing all my rules again and it works again.
>These should not be there and I don't know how they get in there. These keys presumably exist in the global defualts (probably /etc/kde5rc) Our code must be wiping the group. KConfig writes adds a marker rather than deleting the local entry so that it knows to override them with the face that they're deleted. We probably want: KConfig cfg("kwinrulesrc", NoGlobals); Which I can do now. Though fixing this won't apply retro-actively to broken configs.
*When KConfig writes it adds a marker rather than deleting the local entry so that it knows to override them with the fact that they're deleted.
Do I see correctly that you use force temporarily rules?
Git commit f3060723e126909a19d221401a473d4e2d3999b7 by David Edmundson. Committed on 19/12/2018 at 13:07. Pushed by davidedmundson into branch 'master'. [kcmkwin/kwinrules] Don't include kdeglobals in rules config Summary: There's nothing relevant in kdeglobals and loading it can lead to noise when deleting groups that override a system default. We still cascade which will allow kiosk keys to work as well as relevant system defaults. Import/Export is unchanged as that already uses SimpleConfig which includes this flag. I don't know if it will fix the relevant issue in the bug or just reduce noise. Test Plan: Compiled. Reviewers: #kwin, zzag Reviewed By: #kwin, zzag Subscribers: zzag, kwin Tags: #kwin Differential Revision: https://phabricator.kde.org/D17645 M +1 -1 data/update_default_rules.cpp M +1 -1 kcmkwin/kwinrules/kcm.cpp M +2 -2 kcmkwin/kwinrules/main.cpp https://commits.kde.org/kwin/f3060723e126909a19d221401a473d4e2d3999b7
>Do I see correctly that you use force temporarily rules? Yes, I wanted the behaviour to be that when the window first opens, it triggers the resize and reposition based on the rules, but then after than I wanted to still be able to move the windows around and resize them manually. I went through all the options and could not get it to work that way, with force temporary the windows were getting set according to the rules but then the rules were being 'erased'. Over the last week I changed all my rules to 'force' and I haven't had the problem with the rules getting erased or forgotten. It was been working perfectly as it should. So it seems like the issue is with 'force temporary' rules.
(In reply to laxmanpradhan from comment #10) > Yes, I wanted the behaviour to be that when the window first opens, it > triggers the resize and reposition based on the rules, but then after than I > wanted to still be able to move the windows around and resize them manually. > I went through all the options and could not get it to work that way, with > force temporary the windows were getting set according to the rules but then > the rules were being 'erased'. You should use "Apply Initially" rules for that purpose. > So it seems like the issue is with 'force temporary' rules. No, they work as expected.
Marking as NOT A BUG per comment 11.