From 6ba44deee41f9478840159bdf24e1b4c5a4a9ff6 Mon Sep 17 00:00:00 2001 From: Vlad Zahorodnii Date: Mon, 3 Oct 2022 20:32:29 +0300 Subject: [PATCH] effects/maximize: Prevent playing animation for invisible windows If an invisible window is animated, e.g. minimized window, the maximize effect will temporarily make it visible in order to play the animation, which is unexpected. --- src/effects/maximize/package/contents/code/maximize.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/effects/maximize/package/contents/code/maximize.js b/src/effects/maximize/package/contents/code/maximize.js index ebb5163d03..0539306cc9 100644 --- a/src/effects/maximize/package/contents/code/maximize.js +++ b/src/effects/maximize/package/contents/code/maximize.js @@ -27,6 +27,9 @@ class MaximizeEffect { } onWindowMaximizedStateAboutToChange(window) { + if (!window.visible) { + return; + } if (window.maximizeAnimation1) { cancel(window.maximizeAnimation1); delete window.maximizeAnimation1; @@ -50,7 +53,7 @@ class MaximizeEffect { } onWindowMaximizedStateChanged(window) { - if (!window.oldGeometry) { + if (!window.visible || !window.oldGeometry) { return; } window.setData(Effect.WindowForceBlurRole, true);