app switcher takes 4 seconds or more if switching to an application with twelve or more windows and the switch changes workspace
Affected version
Gnome Shell and Mutter 45.3
but as far as I know, this issue is at least 2 years old, maybe from the first Gnome Shell release.
Bug summary
If I open an application with only one window in a workspace and another application with 12 windows or more (usually Firefox, but easer to test and reproduce with gedit empty windows), switching to the gedit application (and workspace) takes 4 seconds or more.
If I open another application (Gnome Settings) with only one window in the workspace with the application with a lot of windows (gedit), switching between these two on the same workspace is instantaneous.
Switching to the other application with only one window (gnome terminal) on another workspace takes one second.
Switching to an application with many windows on another workspace should not take 4 seconds (in fact I have more than 12 windows and the switch ends up taking 6 seconds).
Note the time to switch increases with the number of windows opened by an application when switching to it from another workspace, not from the same workspace.
PS: I disabled all extensions during the test.
Steps to reproduce
Open gnome terminal, switch to the next workspace and open gedit. Then open more gedit windows with Ctr+N until you have 12 or more. Go back to the workspace with gnome terminal and press Alt+Tab to the gedit icon.
What happened
Gnome Shell does not react for 4 seconds (it displays the app switcher with the gedit icon highlighted) before showing gedit.
What did you expect to happen
Gedit window to show in in 2 seconds or less.
Relevant logs, screenshots, screencasts etc.
Screen capture:
Capture vidéo du 2024-01-27 13-23-51.webm
Mutter debug logs:
gs45.3-appSwitch-appWithManyWindowsDifferentWorkspace-20240127.log