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.
This commit is contained in:
tokyo4j 2025-02-17 23:47:07 +09:00 committed by Hiroaki Yamamoto
parent fa6bffa6c6
commit a8cb8aad30

View file

@ -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);