Focus-follows-mouse sometimes focuses the wrong window after switching desktop
Affected version
- Fedora 35
- GNOME 41.3, but observed for a long time
- Wayland, but I believe observed on XOrg.
Bug summary
Intermittently but several times per day, I will switch workspace using a keyboard shortcut and the focused window will not be the maximised window on top of all others, but some other window. If I mouse over a third window on another monitor, then back to the original monitor, the focus will be correct. This scenario can be quite persistent, requiring the windows to be shuffled around (I just fixed this by moving said third window to the first monitor and placing it on top of all three, then switching workspace back and forth, then moving it away again. The problem persists on a third workspace with different windows though)
Steps to reproduce
Unknown beyond the above, but multi-monitor setups, mixed-DPI setups might be involved since they always seem to mess things up.
What happened
The invisible window was focused
What did you expect to happen
The top window in the stack to be focused