Fix focus_follows_mouse switching active window on desktop/space return

When focus_follows_mouse is enabled, returning to a desktop/space fired an
enter event that switched the active window to whichever one was under the
cursor, even though the mouse had not crossed a window boundary.

Distinguish genuine mouse motion into a window from a window reappearing
under a stationary cursor by checking, in cursor_enter_callback, whether the
cursor position actually changed. focus_follows_mouse now switches focus only
when the cursor moved, so motion into a window still switches focus while a
stationary reappearance does not.
This commit is contained in:
David Thiel
2026-06-08 14:46:40 +01:00
parent 79a768ed55
commit 1cc1a445e3
4 changed files with 22 additions and 12 deletions

View File

@@ -178,6 +178,8 @@ Detailed list of changes
- macOS: Show a key symbol on the active tab if the macOS Secure Input feature is enabled
- Fix :opt:`focus_follows_mouse` switching the active window when returning to a desktop/space, even though the mouse did not move. Now the window under a stationary cursor is left alone, while moving the mouse across windows still switches focus as before.
0.47.2 [2026-06-07]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~