Skip to main content

monitor_index_by_rect

Function monitor_index_by_rect 

Source
fn monitor_index_by_rect(
    needle: &MonitorRect,
    rects: &[MonitorRect],
) -> Option<usize>
Expand description

Locate needle in rects by identity-ish geometry match on position and size. available_monitors and primary_monitor return independent Monitor values, so the only stable cross-reference is their reported rect. Pure so the lookup is unit-testable.