Use somewhat proper delay calculation

This should in principle start the animation when the obscuring window have
moved margin - margin_lr frames, which is in the ballbark of what we want.

Had to divide the whole thing by two, not sure why that should've been necessary.

It might be better to use easeOutQuad though, since the other windows are
already moving.
This commit is contained in:
Tor Hedin Brønner
2017-09-17 16:03:35 +02:00
parent e937745a65
commit a309776f37
+7 -1
View File
@@ -175,7 +175,13 @@ ensure_viewport = (meta_window, force) => {
}
// Add a delay for stacked window to avoid windows passing
// through each other in the z direction
let delay = meta_window.get_compositor_private().is_scaled() ? 0.03 : 0;
let delay = 0;
if (meta_window.get_compositor_private().is_scaled()) {
// easeInQuad: delta/2(t/duration)^2 + start
delay = Math.pow(2*(window.margin - margin_lr)/frame.width, .5)*0.25/2;
debug('delay', delay)
}
move_to(meta_window, x, y, delay);
}