From: Sebastian Keller <skeller@gnome.org>
Date: Wed, 1 Mar 2023 21:43:15 +0100
Subject: overview: Don't claim to be SHOWN when HIDDEN during startup
 animation

When the overview gets hidden during the startup animation, the callback
would still change the state to SHOWN, despite the overview not being
shown.

This can happen for example if a `monitors-changed` signal triggers a
relayout during startup.

Bug: https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2514#note_1683525
Bug: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/6478
Bug-Debian: https://bugs.debian.org/1032497
Forwarded: https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2667
Origin: upstream, 44.rc, commit:bb42973730a1a96881cb63bf7c1e9fdc68fb9fba
---
 js/ui/overview.js | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/js/ui/overview.js b/js/ui/overview.js
index a3540d4..cd4b01b 100644
--- a/js/ui/overview.js
+++ b/js/ui/overview.js
@@ -684,6 +684,12 @@ var Overview = class extends Signals.EventEmitter {
         this._changeShownState(OverviewShownState.SHOWING);
 
         this._overview.runStartupAnimation(() => {
+            // Overview got hidden during startup animation
+            if (this._shownState !== OverviewShownState.SHOWING) {
+                callback();
+                return;
+            }
+
             if (!this._syncGrab()) {
                 callback();
                 return;
