]> git.mdlowis.com Git - proto/labwc.git/commitdiff
cursor: don't un-minimize previewed window while window switching
authortokyo4j <hrak1529@gmail.com>
Mon, 17 Feb 2025 14:47:07 +0000 (23:47 +0900)
committerHiroaki Yamamoto <hrak1529@gmail.com>
Mon, 17 Feb 2025 16:33:21 +0000 (01:33 +0900)
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

index fdaaa59c8e90391830aa1544bee987f551c51be4..e9ae9ad0bce9f687e8a49a01003bac2ccaeb2ff9 100644 (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);