[gnome-shell] windowManager: Use one consistent animation mode for minimize/unminimize



commit 9069183cecaf71346ee39cc0adadc1c6213003bc
Author: Daniel van Vugt <daniel van vugt canonical com>
Date:   Thu Dec 16 15:28:20 2021 +0800

    windowManager: Use one consistent animation mode for minimize/unminimize
    
    Firstly don't use EASE_IN for any minimize/unminimize animations because
    those start slow and end fast. The effect of that was minimize/unminimize
    appearing to be unresponsive to user clicks for a little while before
    accelerating away. All such animations should be EASE_OUT for an immediate
    response followed by deceleration at the end.
    
    Secondly we replace the shallow 200ms QUADratic curves with a steeper
    400ms EXPOnetial curve. Because it's steeper and twice as long the fast part
    feels the same as 200ms QUAD, but there's an extra 200ms after that in which
    to slow down smoothly giving a more fluid appearance. No sudden stops.
    
    Fixes: https://bugzilla.gnome.org/show_bug.cgi?id=786789
    Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2066>

 js/ui/windowManager.js | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)
---
diff --git a/js/ui/windowManager.js b/js/ui/windowManager.js
index 50bfbab695..784f793935 100644
--- a/js/ui/windowManager.js
+++ b/js/ui/windowManager.js
@@ -21,7 +21,8 @@ const WorkspaceAnimation = imports.ui.workspaceAnimation;
 const { loadInterfaceXML } = imports.misc.fileUtils;
 
 var SHELL_KEYBINDINGS_SCHEMA = 'org.gnome.shell.keybindings';
-var MINIMIZE_WINDOW_ANIMATION_TIME = 200;
+var MINIMIZE_WINDOW_ANIMATION_TIME = 400;
+var MINIMIZE_WINDOW_ANIMATION_MODE = Clutter.AnimationMode.EASE_OUT_EXPO;
 var SHOW_WINDOW_ANIMATION_TIME = 150;
 var DIALOG_SHOW_WINDOW_ANIMATION_TIME = 100;
 var DESTROY_WINDOW_ANIMATION_TIME = 150;
@@ -1153,7 +1154,7 @@ var WindowManager = class {
             actor.ease({
                 opacity: 0,
                 duration: MINIMIZE_WINDOW_ANIMATION_TIME,
-                mode: Clutter.AnimationMode.EASE_OUT_QUAD,
+                mode: MINIMIZE_WINDOW_ANIMATION_MODE,
                 onStopped: () => this._minimizeWindowDone(shellwm, actor),
             });
         } else {
@@ -1184,7 +1185,7 @@ var WindowManager = class {
                 x: xDest,
                 y: yDest,
                 duration: MINIMIZE_WINDOW_ANIMATION_TIME,
-                mode: Clutter.AnimationMode.EASE_IN_EXPO,
+                mode: MINIMIZE_WINDOW_ANIMATION_MODE,
                 onStopped: () => this._minimizeWindowDone(shellwm, actor),
             });
         }
@@ -1218,7 +1219,7 @@ var WindowManager = class {
             actor.ease({
                 opacity: 255,
                 duration: MINIMIZE_WINDOW_ANIMATION_TIME,
-                mode: Clutter.AnimationMode.EASE_OUT_QUAD,
+                mode: MINIMIZE_WINDOW_ANIMATION_MODE,
                 onStopped: () => this._unminimizeWindowDone(shellwm, actor),
             });
         } else {
@@ -1250,7 +1251,7 @@ var WindowManager = class {
                 x: xDest,
                 y: yDest,
                 duration: MINIMIZE_WINDOW_ANIMATION_TIME,
-                mode: Clutter.AnimationMode.EASE_IN_EXPO,
+                mode: MINIMIZE_WINDOW_ANIMATION_MODE,
                 onStopped: () => this._unminimizeWindowDone(shellwm, actor),
             });
         }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]