Q: Why the hell did you rewrite this effect in C++ anyway?
A: In order to cooperate with effects that animate the disappearing of
windows(e.g. the Glide effect), the rewritten Dialog Parent effect
imposes special rules on animations that can't be implemented in JavaScript.
The main motivation for rewriting this effect was to fix flickering with
alternative effects that animate the disappearing of windows(e.g. the Glide
effect, the Fall Apart effect, etc).
With only the Fade effect being used, there is no flickering of parent
windows because duration of the "Out" animation in the Fade effect is
greater than duration of the "Out" animation in the Dialog Parent effect.
The flickering problem is fixed by "freezing" current state of parent
window and dimming it [the parent window] as long as the effect that
animates its disappearing needs it.
The rewritten Dialog Parent effect also gained a new behaviour: if there
is an active full screen effect, dimmed parent windows start smoothly
brightening. That fixes parent windows being too much dark in Present Windows
and also rapid brightening when sliding between virtual desktops.