From a309776f378faa3357f7ddee8a1b12d4cd55b23e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Hedin=20Br=C3=B8nner?= Date: Sun, 17 Sep 2017 16:03:35 +0200 Subject: [PATCH] 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. --- tiling.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tiling.js b/tiling.js index 482dfb2..ba422e6 100644 --- a/tiling.js +++ b/tiling.js @@ -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); }