Closing window switches focus to window under cursor instead of next in stacking order with focus-follows-mouse
This stems from this Ubuntu issue: https://bugs.launchpad.net/gnome-shell/+bug/1969602
In that, with the Gnome version shipping with Ubuntu 22.04 (and probably newer non-LTS versions too) with Wayland, there is a behavioural regression with the focus-follows-mouse functionality, that is commonly exposed via the Tweaks app.
As of this writing I'm on GNOME 42.9.
For those of us who care about focus-follows-mouse this is a productivity workflow issue, and currently the work-around seems to be switch from Wayland to Xorg/X11.
Here is a rough explanation of an example:
- Have multiple windows open. Steam maximised behind, two gedit windows open but not one on top of the other.
- gedit window gnome-shell#1 (closed) is what I had focus of, then I open gedit window gnome-shell#2 (moved), steam was already opened before gedit window gnome-shell#1 (closed), and is behind both windows of gedit at this point.
- close gedit window gnome-shell#2 (moved) by clicking the X on the window dressing
- instead of focus going back to gedit window gnome-shell#1 (closed), focus goes back to steam, because it is now the application "under" my mouse, as gedit window gnome-shell#1 (closed) is NOT under my mouse
Now the issue isn't necessarily the focus SWITCH, but to clarify more specifically, the steam window COMES TO THE FRONT in addition to focus change, which really is an important detail, as now I can't even see gedit window gnome-shell#1 (closed) as steam is over top of it.
This behaviour was NOT the case for Ubuntu 20.04 (I do not recall what version of GNOME that ships with). And I just tested on x11/xorg, the bring to front part of the focus switch does NOT happen, so this is specific to Wayland usage.
The outcome of this is that every time this happens I have to manually switch focus to the window I meant to, but is probably now behind another window. Do this countless times per hour, and it's not only problematic for workflows, it's aggravating.
To-date this seems to be 100% consistent, as I've observed this every time on any new Ubuntu 22.04 system with Wayland running. So hopefully this can at some point get fixed.