Remove cruft related to window switcher and keyboard focus

This commit cleans up the comments and cruft from e45fe08.

Background:

- With e45fe08, the keyboard focus is always moved to the switched window
  on finishing window switcher, even with <focus followMouse="yes">.
  Since followMouseRequiresMovement was not implemented at that time
  (behaved like it was always "no"), e45fe08 was necessary to allow users
  users who use followMouse="yes" to move the keyboard focus with window
  switcher.
- 9a9e20d added followMouseRequiresMovement, but it kept the behavior
  described above even with followMouse="yes" and
  followMouseRequiresMovement="no".
- 398b80b accidentally invalidated e45fe08, which means the keyboard focus
  is now always moved to the window below the cursor on finishing window
  switcher with followMouse="yes" and followMouseRequiresMovement="no".

Although the invalidation was a accident, I think always setting the
keyboard focus on the window below the cursor is what users expect from
followMouse="yes" and followMouseRequiresMovement="no".
This commit is contained in:
tokyo4j 2024-12-31 13:00:32 +09:00 committed by Consolatis
parent 304a94e716
commit 7a6ecca804
2 changed files with 6 additions and 13 deletions

View file

@ -637,10 +637,11 @@ _cursor_update_focus(struct server *server)
struct cursor_context ctx = get_cursor_context(server);
if ((ctx.view || ctx.surface) && rc.focus_follow_mouse
&& !rc.focus_follow_mouse_requires_movement
&& server->input_mode
!= LAB_INPUT_STATE_WINDOW_SWITCHER) {
/* Prevents changing keyboard focus during A-Tab */
&& !rc.focus_follow_mouse_requires_movement) {
/*
* Always focus the surface below the cursor when
* followMouse=yes and followMouseRequiresMovement=no.
*/
desktop_focus_view_or_surface(&server->seat, ctx.view,
ctx.surface, rc.raise_on_focus);
}