From a9c74ed78febef246cb931400767b5ca65f85c80 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Wed, 24 Jun 2020 15:28:53 +0200 Subject: [PATCH] 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 (cherry picked from commit 26d27fdbf8477960595ae79514f9b7b8b791ae73) --- 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 2e6b93da6..ba09b9a91 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