[gnome-shell] workspaceSwitcherPopup: Fix fading in



commit 00ccea48a6667878f7346328abb1a09345f92165
Author: Florian Müllner <fmuellner gnome org>
Date:   Wed Jan 26 01:43:15 2022 +0100

    workspaceSwitcherPopup: Fix fading in
    
    The popover is supposed to fade in, but that's currently
    broken because:
    
     - we already start at full opacity
     - Clutter skips transitions while unmapped
    
    Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2127>

 js/ui/workspaceSwitcherPopup.js | 19 +++++++++----------
 1 file changed, 9 insertions(+), 10 deletions(-)
---
diff --git a/js/ui/workspaceSwitcherPopup.js b/js/ui/workspaceSwitcherPopup.js
index c70b6f7bf7..9c5b3a9a71 100644
--- a/js/ui/workspaceSwitcherPopup.js
+++ b/js/ui/workspaceSwitcherPopup.js
@@ -175,15 +175,6 @@ class WorkspaceSwitcherPopup extends St.Widget {
         this._container.y = workArea.y + Math.floor((workArea.height - containerNatHeight) / 2);
     }
 
-    _show() {
-        this._container.ease({
-            opacity: 255,
-            duration: ANIMATION_TIME,
-            mode: Clutter.AnimationMode.EASE_OUT_QUAD,
-        });
-        this.show();
-    }
-
     display(activeWorkspaceIndex) {
         this._activeWorkspaceIndex = activeWorkspaceIndex;
 
@@ -192,7 +183,15 @@ class WorkspaceSwitcherPopup extends St.Widget {
             GLib.source_remove(this._timeoutId);
         this._timeoutId = GLib.timeout_add(GLib.PRIORITY_DEFAULT, DISPLAY_TIMEOUT, 
this._onTimeout.bind(this));
         GLib.Source.set_name_by_id(this._timeoutId, '[gnome-shell] this._onTimeout');
-        this._show();
+
+        const duration = this.visible ? 0 : ANIMATION_TIME;
+        this.show();
+        this._container.opacity = 0;
+        this._container.ease({
+            opacity: 255,
+            duration,
+            mode: Clutter.AnimationMode.EASE_OUT_QUAD,
+        });
     }
 
     _onTimeout() {


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