Skip to main content

next_submenu_selection

Function next_submenu_selection 

fn next_submenu_selection(
    grid: &ClientGrid,
    current_pid: Option<u32>,
    anchor_col: Option<i32>,
    direction: NavigationDirection,
    edge: EdgeBehavior,
) -> (Option<u32>, Option<i32>)
Expand description

Compute the next submenu selection given a grid step.

Re-anchors on the first surviving client when current_pid is no longer present (retained out while the submenu was open).

§Arguments

  • grid - Spatial grid view over the currently tracked clients.
  • current_pid - PID currently highlighted, or None.
  • anchor_col - Anchor column carried from earlier moves.
  • direction - Direction the navigation keystroke encoded.
  • edge - Behavior when the move would leave the grid.

§Returns

(new_pid, new_anchor_col) to apply, or (None, None) for an empty cluster.