Do not save kwinrulesrc on every window opening/closing
ClosedPublic

Authored by graesslin on May 7 2018, 8:05 PM.

Details

Summary

Our rule handling has had a grave error for years. Whenever a window
with a rule was openend or closed the kwinrulesrc was written back to
disk.

The reason for this behavior is that temporary rules need to be discarded
once they were used. For that there is a method discardUsed which invokes
requestDiskStorage whenever a rule for the window was found. But it did
not check whether there was a rule requiring this.

This change modifies the discardUsed to track whether it changed a rule
and only writes back in case there was a change.

BUG: 393911
FIXED-IN: 5.12.X

Test Plan

Only compile tested

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 created this revision.May 7 2018, 8:05 PM
Restricted Application added a project: KWin. · View Herald TranscriptMay 7 2018, 8:05 PM
Restricted Application added a subscriber: kwin. · View Herald Transcript
graesslin requested review of this revision.May 7 2018, 8:05 PM
romangg added a subscriber: romangg.May 9 2018, 2:52 PM

What's the difference between DISCARD_USED_FORCE_RULE and DISCARD_USED_SET_RULE? I only found the temporarily force rule in the window settings. Or does set rule just mean a rule, which have been changed while the window was alive?

What's the difference between DISCARD_USED_FORCE_RULE and DISCARD_USED_SET_RULE? I only found the temporarily force rule in the window settings. Or does set rule just mean a rule, which have been changed while the window was alive?

We have force and set rules. The drop-downs have different values. I have to admit that I don't really know the difference of those rules

romangg accepted this revision as: KWin, romangg.May 9 2018, 3:47 PM

Ok, then let's go with this to reduce the writes quickly.

This revision is now accepted and ready to land.May 9 2018, 3:47 PM

iirc the set rules are used by kstart

This revision was automatically updated to reflect the committed changes.