[gnome-shell] overview: Define ANIMATION_TIME earlier



commit 26d27fdbf8477960595ae79514f9b7b8b791ae73
Author: Florian Müllner <fmuellner gnome org>
Date:   Wed Jun 24 15:28:53 2020 +0200

    overview: Define ANIMATION_TIME earlier
    
    Commit c7e597cf7278 tried to improve the slide animations when entering
    the overview by using the same time as the overall overview animation,
    but in fact broke the animation most of the times.
    
    That is because the Overview imports OverviewControls before defining
    the ANIMATION_TIME variable, so any javascript code that is evaluated
    during that import will see the value as "undefined" (which is converted
    to 0 for the animation).
    
    Fix this by moving the ANIMATION_TIME variable before the imports instead
    of the usual placement.
    
    https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1331

 js/ui/overview.js | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
---
diff --git a/js/ui/overview.js b/js/ui/overview.js
index c5adf8e7d0..471a7e3b72 100644
--- a/js/ui/overview.js
+++ b/js/ui/overview.js
@@ -4,6 +4,10 @@
 const { Clutter, GLib, GObject, Meta, Shell, St } = imports.gi;
 const Signals = imports.signals;
 
+// Time for initial animation going into Overview mode;
+// this is defined here to make it available in imports.
+var ANIMATION_TIME = 250;
+
 const Background = imports.ui.background;
 const DND = imports.ui.dnd;
 const LayoutManager = imports.ui.layout;
@@ -14,9 +18,6 @@ const OverviewControls = imports.ui.overviewControls;
 const Params = imports.misc.params;
 const WorkspaceThumbnail = imports.ui.workspaceThumbnail;
 
-// Time for initial animation going into Overview mode
-var ANIMATION_TIME = 250;
-
 // Must be less than ANIMATION_TIME, since we switch to
 // or from the overview completely after ANIMATION_TIME,
 // and don't want the shading animation to get cut off


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