Skip to main content

resolve_overlay_indices

Function resolve_overlay_indices 

Source
fn resolve_overlay_indices(
    placement: MonitorPlacement,
    primary: Option<usize>,
    active: Option<usize>,
    monitor_count: usize,
    wayland: bool,
) -> Vec<usize>
Expand description

Resolve a placement to the set of monitor indices that should each get an overlay window, given what the windowing system could report.

On macOS / Windows / X11 every returned index is pinned to its physical monitor via set_position, so the indices map one-to-one onto screens.

On Wayland the result is collapsed to a single index. The compositor owns window placement: an app cannot move a surface to an absolute (x, y) or target a specific output, and set_position is a no-op there (tauri #6394 / tao). Building one overlay per monitor — as we do elsewhere — therefore does NOT spread the overlays across screens; the compositor stacks every one of them onto the same physical output, which is exactly Steffi’s #67 report (two overlays, both on the secondary monitor, each showing a different hint). We cannot honour “active” / “primary” / “all” by output on Wayland, so we build exactly one overlay and fullscreen it; the compositor decides which monitor. Collapsing to one window also removes the duplicate-overlay symptom. Pure so every branch is unit-testable without a windowing system.