Skip to main content

place

Function place 

Source
pub fn place(
    monitors: &[MonitorRecord],
    regions: &[Region],
    global_x: i32,
    global_y: i32,
) -> Result<Placement, PlaceError>
Expand description

Place a global physical point into the logical space of whichever granted region covers its monitor.

The arithmetic is deliberately small: subtract the monitor’s physical origin, divide by that monitor’s scale to get logical pixels, then add the region’s logical offset. The region’s offset is the monitor’s position in the compositor’s logical layout, which is why no global logical layout has to be known or guessed.