[effects/slide] Simplify logic that forces blur and background contrast
ClosedPublic

Authored by zzag on Sep 23 2018, 11:58 AM.

Details

Summary

The "Force" part in WindowForceBackgroundContrastRole and WindowForceBlurRole
is confusing. If WindowForceBlurRole is set on a window, background
behind it won't be blurred.

By setting WindowForceBlurRole we tell the Blur effect "that's fine to
do your business behind transformed windows."

The Slide effect only translates windows, it doesn't distort them, etc.
So, we can set WindowForceBackgroundContrastRole and WindowForceBlurRole
for all windows.

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.Sep 23 2018, 11:58 AM
Restricted Application added a project: KWin. · View Herald TranscriptSep 23 2018, 11:58 AM
Restricted Application added a subscriber: kwin. · View Herald Transcript
zzag requested review of this revision.Sep 23 2018, 11:58 AM

The "Force" part in WindowForceBackgroundContrastRole and WindowForceBlurRole is confusing.

It really is.

I don't understand why we still do

if ((scaled || (translated || (mask & PAINT_WINDOW_TRANSFORMED))) && !w->data(WindowForceBlurRole).toBool())

in blur given blur now supports both translation and scaling.
I think we can kill that (leaving the mask check for coverswitch) and then remove all the force stuff from this effect.

Does that make sense?

effects/slide/slide.cpp
394–395

Do we need to call this from the dtor in case the effect is unloaded whilst we're active?

Not implausible if the user closes the "do you want to apply settings" prompt in kwin system settings.

zzag added a comment.Sep 28 2018, 5:26 PM

I don't understand why we still do

if ((scaled || (translated || (mask & PAINT_WINDOW_TRANSFORMED))) && !w->data(WindowForceBlurRole).toBool())

in blur given blur now supports both translation and scaling.
I think we can kill that (leaving the mask check for coverswitch) and then remove all the force stuff from this effect.

Does that make sense?

I agree, but I think we still need "force" roles. (to support third party full screen effects)

effects/slide/slide.cpp
394–395

Hmm, yeah, maybe.

I agree, but I think we still need "force" roles. (to support third party full screen effects)

Cool, I'll give it a go

zzag updated this revision to Diff 42515.Sep 28 2018, 6:10 PM

Call stop from destructor

davidedmundson accepted this revision.Oct 1 2018, 11:39 PM
This revision is now accepted and ready to land.Oct 1 2018, 11:39 PM
This revision was automatically updated to reflect the committed changes.