Mutter raises the wrong window after close, when using Focus on Hover
Affected version
This is on Gnome 45, running under Fedora 39, though I believe it's been present for at least one more major Gnome release.
Affects both Wayland and XOrg
Bug summary
When Focus on Hover is set (Gnome Tweaks > Windows > Focusing) and a window is closed, mutter seems to raise the most recently focused window, even if that window was not the most recently raised.
Concretely, if there is a large window on the bottom, and two smaller windows on top of it, changing focus with the mouse from one small window to another, can cause the larger window to jump from the bottom to the top of the stack.
Steps to reproduce
- Open Gnome Tweaks, and set Windows > Focus to "Focus on Hover"
- Open a Terminal and resize it to nearly fill the screen
- Open a smaller Terminal window, and place it in the upper-left
- Open a smaller Terminal window, and place it in the lower-right, with a gap between it and the other Terminal
- Move the mouse to the Terminal in the upper-left
- Close the Terminal window with Ctrl-D
- The large Terminal jumps from the back of the window stack to the front
What happened
The stacking of windows was changed.
What did you expect to happen
I expected Mutter to leave the stack alone, and have the Terminal in the lower-right remain on top, as it did in earlier Gnome releases.