Skip to main content

grid_dimensions

Function grid_dimensions 

pub(super) fn grid_dimensions(
    n: i32,
    aspect: f64,
    aspect_adj: f64,
) -> (i32, i32)
Expand description

Compute the grid dimensions for n clients on a workspace with the given aspect ratio.

Must match the formula used by the tiler in super::determine_client_spatial_attributes so layout and navigation stay in sync.

§Arguments

  • n - Number of client windows.
  • aspect - workspace_width / workspace_height (including frame padding) of the available area.
  • aspect_adj - The aspect_ratio_adjustment daemon config.

§Returns

(cols, rows), each clamped to a minimum of 1.