[effects] Ignore previous state of WindowForceBlurRole
ClosedPublic

Authored by zzag on Jun 11 2018, 11:51 AM.

Details

Summary

Currently, effects like Maximize, Slide Back have problems with setting
WindowForceBlurRole. They store previous state of WindowForceBlurRole.
This is wrong. Instead they should either ignore previous state of
WindowForceBlur or refcount forced role.

There's no need for refcounting right now. For example, if several effects
force blur or background contrast, they are most likely in a conflict.
Please notice that the Desktop Grid effect uses the Present Windows
effect only to calculate transformations.

Some other problems with the code that sets WindowForceBlurRole:

  • Maximize effect stores previous state of WindowForceBlurRole only for one window. It ignores the fact that there could be several active maximize animations;
  • Desktop Grid/Present Windows/Slide back don't clean after themselves. So, after using those effects for good amount of times, memory usage will bump.
Test Plan
  • Enabled blur for Konsole
  • Maximized Konsole
  • Activated Present Windows
  • Activated Desktop Grid
  • Raised another window(to trigger Slide Back)

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.
zzag created this revision.Jun 11 2018, 11:51 AM
Restricted Application added a project: KWin. · View Herald TranscriptJun 11 2018, 11:51 AM
Restricted Application added a subscriber: kwin. · View Herald Transcript
zzag requested review of this revision.Jun 11 2018, 11:51 AM
zzag edited the summary of this revision. (Show Details)Jun 11 2018, 11:56 AM
fredrik accepted this revision.Jun 19 2018, 11:47 AM
fredrik added a subscriber: fredrik.

It would be easy to change WindowForceBlurRole from a bool to an int, and have effects increment/decrement the value though.

This revision is now accepted and ready to land.Jun 19 2018, 11:47 AM
zzag added a comment.EditedJun 19 2018, 11:54 AM

It would be easy to change WindowForceBlurRole from a bool to an int, and have effects increment/decrement the value though.

So, it will be essentially refcounting. I think it can break "compatibility" with third-party effects. I proposed some time ago to add the following methods

void force(int role);
void unforce(int role);
bool hasForced(int role);

to EffectWindow, which are doing refcounting stuff.

This revision was automatically updated to reflect the committed changes.