Extensions aren't properly rebased when suspending
Affected version
- Fedora 40
- Gnome 46
- Both Wayland and X11
Bug summary
There are two extensions which both patch the WorkspaceAnimationController.prototype._prepareWorkspaceSwitch
function. If you suspend the system, the extensions may be disabled in the wrong order, which will lead to recursion when they are re-enabled (example in the logs below)
Steps to reproduce
- Install the "Blur My Shell" extension
- Install the "Rounded Window Corners" extension from here
- Suspend the system and turn it back on
- Try to switch workspaces
What happened
Workspaces can't be switched anymore. If you look at gnome-shell logs, you'll see a recursion error there whenever you try to change the workspace. More information is in the "relevant logs" section.
What did you expect to happen
Extensions should be correctly rebased when suspending the system, so the function should be reset to gnome default when suspending and patched by both extensions when unsuspending. This is what happens if you manually disable and enable the extensions in any order, but not when suspending the system.
Relevant logs, screenshots, screencasts etc.
I added extra logging to those extensions to see the order in which the extensions patch and restore the function. Here are the relevant parts of the logs while suspending and turning on the system:
[Blur my Shell] Enabling
[Blur my Shell] Wrapping function that is GNOME DEFAULT
[Rounded Corners] Enabling
[Rounded Corners] Wrapping function that is BLUR MY SHELL PATCHED
------------------------------------------------------------------
[Blur my Shell] Disabling
[Blur my Shell] Resetting function to GNOME DEFAULT
[Rounded Corners] Disabling
[Rounded Corners] Resetting function to BLUR MY SHELL PATCHED
[Blur my Shell] Enabling
[Blur my Shell] Wrapping function that is BLUR MY SHELL PATCHED ⚠️
[Rounded Corners] Enabling
[Rounded Corners] Wrapping function that is BLUR MY SHELL PATCHED
As you can see, Blur My Shell initially gets enabled before Rounded Corners, but when suspending the system, it also gets disabled first. This leads to it wrapping its own function and causing infinite recursion.