From a8cb8aad30f50bacba944d9915d989e91ee3b708 Mon Sep 17 00:00:00 2001 From: tokyo4j Date: Mon, 17 Feb 2025 23:47:07 +0900 Subject: [PATCH] cursor: don't un-minimize previewed window while window switching This commit restores the check removed in 7a6ecca. Without the check, if followMouse="yes" and followMouseRequiresMovement="no", osd_update() => cursor_update_focus() => desktop_focus_view() unexpectedly un-minimizes the window on cursor even when the window is just a preview of window switcher. This caused some strange behavior that a minimized window selected with window switcher is immediately hidden after finishing window switching. --- src/input/cursor.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/input/cursor.c b/src/input/cursor.c index fdaaa59c..e9ae9ad0 100644 --- a/src/input/cursor.c +++ b/src/input/cursor.c @@ -641,10 +641,15 @@ _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) { + && !rc.focus_follow_mouse_requires_movement + && server->input_mode + != LAB_INPUT_STATE_WINDOW_SWITCHER) { /* * Always focus the surface below the cursor when * followMouse=yes and followMouseRequiresMovement=no. + * + * We should ignore them while window-switching though, because + * calling desktop_focus_view() un-minimizes previewed window. */ desktop_focus_view_or_surface(&server->seat, ctx.view, ctx.surface, rc.raise_on_focus);