From d7185d71c6c5b51749cbd4e92b3730c60ee259f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20Dre=C3=9Fler?= Date: Tue, 12 May 2020 12:22:52 +0200 Subject: [PATCH] windowManager: Clean up starting of size-change animations a bit We can do without having two calls to shellwm.completed_size_change() in there, so use an early return for all cases. https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1251 --- js/ui/windowManager.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/js/ui/windowManager.js b/js/ui/windowManager.js index 3dacca2ec..e05c02305 100644 --- a/js/ui/windowManager.js +++ b/js/ui/windowManager.js @@ -1278,13 +1278,13 @@ var WindowManager = class { } _sizeChangeWindow(shellwm, actor, whichChange, oldFrameRect, _oldBufferRect) { - let types = [Meta.WindowType.NORMAL]; - if (!this._shouldAnimateActor(actor, types)) { - shellwm.completed_size_change(actor); - return; - } + const types = [Meta.WindowType.NORMAL]; + const shouldAnimate = + this._shouldAnimateActor(actor, types) && + oldFrameRect.width > 0 && + oldFrameRect.height > 0; - if (oldFrameRect.width > 0 && oldFrameRect.height > 0) + if (shouldAnimate) this._prepareAnimationInfo(shellwm, actor, oldFrameRect, whichChange); else shellwm.completed_size_change(actor);