[effects/slidingpopups] Overhaul slotPropertyNotify
ClosedPublic

Authored by zzag on Aug 15 2018, 2:54 PM.

Details

Summary
  • Slightly improve readability;
  • Check that offset and location have been passed;
  • Sanitize slide in/out duration (if any of those is equal to 0, KWin will crash).
Test Plan
  • Launched Yakuake;
  • Pressed F12 several times (Yakuake still slides in/out).

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.Aug 15 2018, 2:54 PM
Restricted Application added a project: KWin. · View Herald TranscriptAug 15 2018, 2:54 PM
Restricted Application added a subscriber: kwin. · View Herald Transcript
zzag requested review of this revision.Aug 15 2018, 2:54 PM
zzag added a comment.EditedAug 15 2018, 2:54 PM

I think that's the last patch.

Code of the sliding popups effect is now in much better shape.

zzag edited the summary of this revision. (Show Details)Aug 15 2018, 2:58 PM
davidedmundson accepted this revision.Aug 16 2018, 10:07 PM
davidedmundson added a subscriber: davidedmundson.
davidedmundson added inline comments.
effects/slidingpopups/slidingpopups.cpp
325

what's the rationale behind this cap value?

This revision is now accepted and ready to land.Aug 16 2018, 10:07 PM
zzag added inline comments.Aug 17 2018, 6:15 AM
effects/slidingpopups/slidingpopups.cpp
325

If I understand your question correctly, you ask why we don't allow to use "0" as a duration?

TimeLine will later divide the number number of elapsed milliseconds by this duration (d->elapsed / d->duration), so we have to prevent division by 0.

Also, maybe, in this case, we could do something similar to what we do in reconfigure(), e.g.

animData.slideInDuration = (animData.slideInDuration().count() != 0)
    ? animData.slideInDuration
    : m_slideInDuration;

Yeah, I prefer that suggestion.

zzag updated this revision to Diff 39900.Aug 17 2018, 8:49 AM

Handle special value of duration in setupAnimData

davidedmundson accepted this revision.Aug 17 2018, 8:59 AM
This revision was automatically updated to reflect the committed changes.