D16454: [effects/fadedesktop] Rewrite it
Vlad Zagorodniy <[email protected]>
| Newsgroups | gmane.comp.kde.devel.kwin |
|---|---|
| Message-ID | <[email protected]> |
zzag added inline comments.
INLINE COMMENTS
> davidedmundson wrote in main.js:29
> One of the reasons we said redirect should have an absolute direction rather than "reverse" was so that we can squash this code into something more like:
>
> fadeWindow(window, direction) {
> if (window.animation) {
> redirect(window.animation, direction);
> } else {
> window.animation = animate(....);
> redirect(window, direction);
> }
> }
>
> which IMHO would be a lot easier to read compared to two functions which have to handle 3 possible states of existing animations.
We don't delete `window.animation`, so we can't just simply redirect the animation.
Also, from the API standpoint, redirect() can return false, which means it couldn't redirect the animation and some further actions have to be taken (e.g. cancel the animation).
In order to delete window.animation, I assume we need some inspection mechanism to figure out whether all animations has finished.
REPOSITORY
R108 KWin
REVISION DETAIL
https://phabricator.kde.org/D16454
To: zzag, #kwin
Cc: davidedmundson, kwin, mkulinski, ragreen, jackyalcine, Pitel, iodelay, bwowk, ZrenBot, lesliezhai, ali-mohamed, hardening, jensreuterberg, abetts, sebas, apol, mart