D16454: [effects/fadedesktop] Rewrite it

David Edmundson <[email protected]>
Newsgroups gmane.comp.kde.devel.kwin
Message-ID <[email protected]>
davidedmundson added a comment.


  Code is ok, ship it if you want, but I think we can make it a lot simpler.

INLINE COMMENTS

> main.js:26
> +    loadConfig: function () {
> +        "use strict";
> +        fadeDesktopEffect.duration = animationTime(250);

In QJSEngine, we can just write "use strict" once at the top of the file and it will apply for all functions.

I haven't tested QtScript, but I would be surprised if it's different.

> main.js:29
> +    },
> +    fadeInWindow: function (window) {
> +        "use strict";

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.

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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.