feat(wm): add initial_window_placement_rules for workspace-level

Adds a new initial_window_placement_rules workspace configuration option
that allows users to control where new tiled windows are inserted in the
container list. Supports placement by named strategy (Primary,
Secondary, BeforeFocused, AfterFocused, Last), fixed container index, or
per-application matching rules with OR/AND logic.
This commit is contained in:
Csaba
2026-08-22 13:52:38 -07:00
committed by LGUG2Z
parent 4ca2ff84dc
commit 83c4e11d99
10 changed files with 942 additions and 3 deletions
+21
View File
@@ -301,6 +301,27 @@ impl DefaultLayout {
}
}
/// Returns the container index of the primary (largest) pane for this layout.
///
/// For all default layouts, the primary container is always at index 0.
#[must_use]
pub fn primary_index(&self) -> usize {
0
}
/// Returns the container index of the secondary pane for this layout,
/// if there are enough containers. Returns `None` if there are fewer than 2 containers.
///
/// For all default layouts, the secondary container is at index 1.
/// - **BSP**: the second-largest split area
/// - **UltrawideVerticalStack**: the left (secondary) column
/// - **VerticalStack / HorizontalStack / RightMainVerticalStack**: the first container in the stack area
/// - **Columns / Rows / Grid / Scrolling**: simply the second container
#[must_use]
pub fn secondary_index(&self, container_count: usize) -> Option<usize> {
if container_count >= 2 { Some(1) } else { None }
}
#[must_use]
#[allow(clippy::cast_precision_loss, clippy::only_used_in_recursion)]
pub fn resize(